TypeScript SDK
@createworker/sdk is the official, dependency-free Node client. It handles auth, retries, idempotency, and webhook verification.
Install
npm install @createworker/sdkRequires Node 18+. Source: github.com/CreateWorkerAI/createworker-node.
Create a client
import { CreateWorker } from "@createworker/sdk";
const cw = new CreateWorker({
apiKey: process.env.CREATEWORKER_API_KEY!, // cw_live_… / cw_test_…
// baseUrl: "https://www.createworker.com", // default
// timeoutMs: 30_000, maxRetries: 2,
});Resource namespaces
cw.account—get(),usage()cw.workers—list / get / create / update / delete(create/updateacceptexternalExecutor)cw.tasks—list / get / create / cancel / deliverables / waitForTask, plus external-runnerclaim / progress / submitDeliverablecw.chat—pending / messages / reply(answer an external worker's chat)cw.approvals—create();cw.clarifications.answer()cw.deliverables—get()cw.knowledge—list / get / create / deletecw.integrations—connections / createApiConnection / createWebhookConnection / bind / unbind / deleteConnectioncw.webhooks—register / list / get / update / delete
The tasks.claim/progress/submitDeliverable and chat methods are for building an external worker runner.
Helpers
// Poll a task to a terminal/actionable status
const done = await cw.tasks.waitForTask(taskId, { timeoutMs: 120_000 });
// Verify an inbound webhook delivery (throws if invalid)
import { constructEvent, signInboundRequest } from "@createworker/sdk";
const event = constructEvent(rawBody, headers, secret);
// Sign an event your app sends to a CreateWorker webhook connection
const { body, headers } = signInboundRequest(payload, signingSecret);Errors
Non-2xx responses throw
CreateWorkerError with .status, .code, and .referenceId. 429/5xx are retried automatically with backoff.Connect your app
The integrations namespace is how you wire your own product to a worker — see the Connect your app tutorial.