Combined
Get started

TypeScript SDK

Query granted context through the dependency-free Fetch client.

Install the package from the private registry configured for your organization:

pnpm add @combined/context

Set COMBINED_TOKEN to a WorkOS access token or agent API key and COMBINED_API_URL to the HTTPS deployment origin, then create the client. The Account and Source grants are still resolved server-side; possessing a token does not broaden access.

import { ContextOS } from "@combined/context";

const context = new ContextOS();
const sources = await context.catalog.list(process.env.COMBINED_ACCOUNT_ID!);

const result = await context.sql.query({
  accountId: process.env.COMBINED_ACCOUNT_ID!,
  sql: `select application, count(*) as events
        from desktop_capture_ab12cd34.context.application_activity
        group by 1 order by 2 desc limit 20`,
});

console.log({ sources: sources.length, rows: result.rows, receipt: result.receiptId });

Mutating methods accept { idempotencyKey } as their final request options. The client generates a cryptographically random key when one is omitted. GET requests retry once for throttling and bounded gateway failures; SQL and mutations are never retried automatically.

Use the TypeScript SDK reference for constructor options, errors, cancellation, pagination, and the complete resource map.