On this page

The SDK — @cotrackpro/sdk

The same typed client the CLI is built on, ready for your own code. One consistent way to authenticate, call the platform, and wire up safety guardrails — in Node, at the edge, in the browser, or inside an AI agent. You don't have to assemble any of it by hand.

What you build with this will handle real families' information, so it's held to the same care you'd put into security: everything is educational and informational only — not legal or clinical advice.

npm install @cotrackpro-dev/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();