SDKs

TypeScript SDK

@tigby/sdk for npm, generated from the API contract with no runtime dependencies.

The package is not on npm yet; this is the command once it is:

npm install @tigby/sdk

Until the package is published, call the API over HTTPS using the API reference. It describes the same endpoints as this package.

Generated from the OpenAPI document, which is itself generated from the running API; the package cannot describe an endpoint the API does not have. The fetch client is bundled; nothing else is installed.

The package is an ES module only; there is no CommonJS build. A CommonJS file on Node 22.12 or later loads it with require("@tigby/sdk"), which those versions do for an ES module. On Node 20, and on 22 before 22.12, require cannot load it; use const tigby = await import("@tigby/sdk") instead.

Use it

The examples use orderbot, a reserved example Handle. Replace it with your own available Handle before creating an Identity.

import { configureTigby, createIdentity, listIdentities, TigbyError } from "@tigby/sdk";

configureTigby({ apiKey: process.env.TIGBY_API_KEY });

const { data: created } = await createIdentity({ body: { handle: "orderbot" } });
console.log(created.saga.status); // provisioning has started

const { data } = await listIdentities();

For more than one API key in a process, createTigbyClient({ apiKey }) returns a client every operation accepts as { client }.

Both clients default to https://api.tigby.eu, using the host from the generated OpenAPI client. Pass baseUrl: "http://localhost:8080" for a development stack. Requests time out if no response starts within 60 seconds, including connection time. There is no timeout on the response body, so an active download is not interrupted. Set timeout in milliseconds to change the limit, or null to disable it.

Errors

Every refusal raises TigbyError: the RFC 9457 problem as a typed object:

try {
  await createIdentity({ body: { handle: "orderbot" } });
} catch (error) {
  if (error instanceof TigbyError) {
    error.code;      // "handle_taken" – stable, branch on it
    error.agentHint; // what to do instead
    error.docUrl;    // where a human reads more
  }
}

Request bodies are limited to 1 MiB (1,048,576 bytes), measured as sent. Editing an A2A Card with PATCH /api/identities/{handle}/card permits 2 MiB (2,097,152 bytes), enough for a card with every field at its maximum length.

Larger requests receive status 413 and request_body_too_large before processing. Nothing changes. Reduce the request size before retrying.

Mail sending uses the same 1 MiB limit for the subject, text and HTML together. Larger requests receive status 413 and send no mail.

On this page