# TypeScript SDK

Propose actions and read results from Node.js.

**Availability:** shared with design partners as a package. Not published to a public registry yet. Requires Node.js 20.11 or later.

```ts
import { DelegrityClient, isTerminal } from "@delegrity/sdk";

const client = new DelegrityClient({
  baseUrl: "https://your-delegrity-address/v1",
  tokenProvider: () => workloadIdentity.currentAccessToken(),
  agentId: "00000000-0000-4000-8000-00000000a9e7",
  sessionId: "00000000-0000-4000-8000-0000000051c2",
});

const proposal = await client.rest.submit({
  requestId: "request-rest-0001",
  toolName: "update_supplier_contact",
  arguments: {
    supplier_id: "SUP-1042",
    contact_channel: "EMAIL",
    contact_value: "payments@example.test",
    reason: "Update remittance contact",
  },
  instruction: "Update supplier contact",
});

const settled = await client.waitForResult(proposal.request_id, {
  timeoutMs: 60_000,
});
if (!isTerminal(settled)) {
  // still awaiting approval, dispatch or reconciliation
}
```

All errors extend `DelegrityError`, with `code`, `statusCode`, `traceId` and `retryAfterSeconds`. Same surface as the Python SDK.
