Install and use @contro1/sdk in Node, TypeScript, Express, Fastify, or Next.js backends to create approval requests, verify webhooks, and write audit records.
Use @contro1/sdk when your agent backend, tool runner, webhook bridge, or application server runs on Node or TypeScript.
Use the integration skill
Copy this skill link into your code agent to add JavaScript / TypeScript SDK and Contro1 to your system.
import { CentcomClient } from '@contro1/sdk';
export const centcom = new CentcomClient({
apiKey: process.env.CENTCOM_API_KEY!,
baseUrl: process.env.CENTCOM_BASE_URL,
});
Create an approval request
Create the request before the risky tool or workflow step executes. Use external_request_id for retries and correlation_id to group related requests and audit records.
Beyond the approval call, attach identity, a run trace, the tools you invoked, and the context you retrieved. Each field is optional — add what you have. The verified identity always comes from your API key; a caller-supplied actor.agent_id is recorded as a claimed sub-agent until an admin verifies it.
trace_id / parent_trace_id — link one run (and sub-agent runs) into a single trace.
tool_calls[] — what the agent tried to do, so reviewers see the actions.
retrieved_context[] — the data the decision was based on (RAG provenance).
Then export a signed evidence packet from GET /requests/:id/evidence.
Send full traceability
// Same approval call you already make — now with full traceability.
await client.requests.create({
request_type: "approval",
title: "Refund $4,200 to customer 8831",
source: { integration: "api" },
actor: { agent_id: "billing-agent", agent_name: "Billing Agent" }, // claimed sub-agent
trace_id: `trc_${runId}`, // link every step of this run
tool_calls: [{ name: "lookup_order", outcome: "success" }],
retrieved_context: [{ source: "policy:refunds", uri: "kb://policy/refunds" }],
continuation: { mode: "decision" },
});