@createworker/sdk

TypeScript SDK

@createworker/sdk is the official, dependency-free Node client. It handles auth, retries, idempotency, and webhook verification.

Install

npm install @createworker/sdk

Requires 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.accountget(), usage()
  • cw.workerslist / get / create / update / delete (create/update accept externalExecutor)
  • cw.taskslist / get / create / cancel / deliverables / waitForTask, plus external-runner claim / progress / submitDeliverable
  • cw.chatpending / messages / reply (answer an external worker's chat)
  • cw.approvalscreate(); cw.clarifications.answer()
  • cw.deliverablesget()
  • cw.knowledgelist / get / create / delete
  • cw.integrationsconnections / createApiConnection / createWebhookConnection / bind / unbind / deleteConnection
  • cw.webhooksregister / 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.