On this page
The SDK — @cotrackpro/sdk
The same typed client the CLI is built on. One surface for transport, pluggable auth, typed API resources, and MCP/artifact bindings — it runs in Node, edge, the browser, and agent hosts.
npm install @cotrackpro/sdk
A first call#
import { createClient, StaticTokenProvider } from "@cotrackpro/sdk";
const cp = createClient({
baseUrl: "https://api.cotrackpro.com",
org: "acme",
auth: new StaticTokenProvider(process.env.COTRACKPRO_TOKEN!),
});
const me = await cp.whoami();
const pkgs = await cp.packages.list();
Pluggable auth#
Pick the provider that matches your runtime — the rest of the SDK is identical:
| Provider | Use case |
|---|---|
StaticTokenProvider |
API keys / env tokens — CI and agents |
DeviceFlowProvider |
browser device-flow sign-in |
CallbackTokenProvider |
read a token from a keychain / store |
CliBrokerProvider |
retrieve gated data via a CLI-brokered token (see Gated access) |
Typed, offline catalog#
@cotrackpro/sdk/mcp ships generated registries of the whole platform surface — no
network, no auth:
import { ARTIFACTS, searchArtifactsLocal } from "@cotrackpro/sdk/mcp";
ARTIFACTS["parenting-plan-draft"].dataSensitivity; // => "confidential"
searchArtifactsLocal("incident"); // ranked, offline
Browse the full set on the Catalog page.
In an MCP host (e.g. Antigravity)#
import { CotrackproToolset } from "@cotrackpro/sdk/mcp";
const cp = new CotrackproToolset((name, args) => host.callTool(`cotrackpro.${name}`, args));
const artifacts = await cp.listArtifacts();