TypeScript SDK Reference

@loxtep/sdk provides typed control-plane APIs, workspace-aware configuration, and data-product event readers and writers.

Client signature

Use the workspace factory for local projects or the constructor for explicit service configuration.

const client = await LoxtepClient.fromWorkspace(options?);
const explicit = new LoxtepClient(options);

Parameters

ParameterTypeDescription
options.api_urlstringPlatform API base URL for explicit configuration.
options.authLoxtepAuthJWT or supported authentication provider.
options.organization_idstring | undefinedOptional organization scope.
options.project_idstring | undefinedOptional project scope.
options.instance_idstring | undefinedOptional runtime instance scope.

Returns

fromWorkspace() returns Promise<LoxtepClient>; the constructor returns a configured LoxtepClient immediately.

Example usage loads the current workspace and its user.

const client = await LoxtepClient.fromWorkspace();
const user = await client.session.get_current_user();

Install

Install the TypeScript package with your project package manager.

pnpm add @loxtep/sdk

Initialize a client

After loxtep login, loxtep init, and loxtep attach, use this workspace-aware initialization.

import { LoxtepClient } from '@loxtep/sdk';

const client = await LoxtepClient.fromWorkspace();
const user = await client.session.get_current_user();

For CI or multi-tenant services, use explicit client configuration.

const client = new LoxtepClient({
  api_url: process.env.LOXTEP_API_URL!,
  auth: {
    type: 'jwt',
    token: process.env.LOXTEP_AUTH_TOKEN!,
  },
  organization_id: process.env.LOXTEP_ORGANIZATION_ID,
  project_id: process.env.LOXTEP_PROJECT_ID,
  instance_id: process.env.LOXTEP_INSTANCE_ID,
});

The constructor uses snake_case option names. Do not use the retired { token, apiUrl } form.

Namespace map

The SDK exposes ten job-aligned namespaces. These are technical API groupings; the customer application areas remain Connect, Products, Meaning, Use, Inbox, and Observe.

Customer areaSDK namespacePrimary resources
Orientationclient.sessionCurrent user and organization
Connectclient.connectConnectors and templates
Productsclient.workspaceProjects, instances, versions, deployments
Productsclient.buildWorkflows, triggers, data products, targets, deployment
Meaning / Orgclient.defineShapes, schemas, quality, contracts, domains
Meaningclient.meaningVocabulary, ontology, packs, proposals, packages
Inboxclient.reviewApprovals, context review, improvements
Useclient.queryCatalog, discovery, analytics
Observeclient.observeRuntime status, queues, deployments
Meaning / Useclient.contextProcedures, process intelligence, agent work

The hosted MCP server has an additional eleventh tool, loxtep_package_review, for an MCP Apps review card. It does not create an eleventh SDK namespace.

Products

Access project, product, and workflow APIs through the Products namespaces.

const projects = await client.workspace.projects.list();

const products = await client.build.data_products.list();
const product = await client.build.data_products.get('<data-product-id>');

const workflows = await client.build.workflows.list({
  project_id: '<project-id>',
});

Control-plane data product and workflow methods live under client.build. Removed flat namespaces such as client.data_products and client.workflows are not the control-plane API.

Connect

Access connector resources through the Connect namespace.

const connectors = await client.connect.connectors.list();
const connector = await client.connect.connectors.get('<connector-id>');
const probe = await client.connect.connectors.test('<connector-id>');

Creating credentials is consequential. Obtain user authorization before calling client.connect.connectors.create(...) or starting sample capture.

Meaning and Inbox

Use Meaning, client.define, and Review namespaces for semantic work and decisions. The define namespace is a stable SDK identifier; customer navigation calls that area Meaning.

const terms = await client.meaning.thesaurus.list_terms();
const concepts = await client.meaning.ontology.list_concepts();
const shapes = await client.define.shapes.list();

const pending = await client.review.approvals.list_pending();
await client.review.approvals.approve('<approval-id>');

Method availability varies by resource. Use the package's generated TypeScript types as the exact signature authority.

Query governed data

Search the catalog and query a product through its governed product API.

const hits = await client.query.catalog.search({ query: 'orders' });
const rows = await client.build.data_products.query(
  '<data-product-id>',
  'SELECT * FROM t LIMIT 10'
);

Queries are scoped to a data product so governance, evidence, and lineage remain attached to the result.

Write and read events

For application event I/O, use the top-level resolver methods. They resolve the deployed queue, bot, and stream configuration from the product name or UUID.

const writer = await client.get_writer('orders', { transport_mode: 'default' });
writer.write({ order_id: 'ord-1', status: 'placed' });
await writer.close();

const reader = await client.get_reader('orders');
for await (const event of reader) {
  console.log(event);
}

Choose default for durable, balanced writes (recommended). fast minimizes latency but may cost more. volume is optimized for sustained throughput and has delivery lag. Omitting transport_mode selects default.

For historical replay or a live data-product stream:

for await (const event of client.build.data_products.replay('<data-product-id>', {
  start: '2026-10-01T00:00:00Z',
  end: '2026-10-02T00:00:00Z',
})) {
  console.log(event);
}

Authentication precedence

Use a scoped LOXTEP_AUTH_TOKEN in CI. For local work, fromWorkspace() loads project-local credentials and .loxtep/project.json. Never embed tokens in source code.