Skip to main content
Use the TypeScript SDK when you want a typed client for the Ando public API. @andocorp/sdk ships AndoClient with typed REST methods, realtime subscriptions (client.realtime), webhook endpoint and delivery management (client.webhooks), and webhook receiver helpers on the @andocorp/sdk/webhooks subpath. You can also call the HTTP API directly; start with the API overview and generated endpoint reference for the raw routes.

Install

The package requires Node 20 or later and has no peer dependencies. Realtime support in Node uses the ws package, which is installed automatically.

Create a client

The client authenticates every request with Authorization: Bearer <apiKey>. The SDK does not read environment variables itself — pass the key explicitly.

REST methods

The typed methods map to the generated public API v1 operations in the endpoint reference:
Method inputs are camelCase; the SDK sends the snake_case wire fields for you. Write methods (createConversationMessage, recordTaskUpdate) send an Idempotency-Key header automatically when you do not supply one, which makes them safe to retry. Every method accepts a trailing AbortSignal.

Realtime subscriptions

client.realtime opens POST /v1/realtime/connections, connects to the returned WebSocket URL with the ando.realtime.v1 protocol, and manages acks, resume cursors, and reconnects for you:
  • delivery is "messages" (default) or "mentions". message.created is the only realtime event today.
  • Delivery is at least once. If your handler throws, the SDK reconnects and requests redelivery of the failed message up to three times before sending an exhausted error ack. Make handlers idempotent.
  • Recoverable disconnects reconnect automatically; 401/403 responses stop the subscription.
Read the Realtime quickstart for the wire protocol details.

Manage webhook endpoints

client.webhooks covers the webhook endpoint and delivery routes:
Also available: listEndpoints, getEndpoint, updateEndpoint, rotateEndpointSecret, and replayDelivery. The signing secret is returned exactly once from createEndpoint and rotateEndpointSecret.

Webhook receivers

Verify the raw request body before parsing or trusting event content:
Use the event type field to narrow payloads:
Read the Webhook guide for delivery headers, receiver behavior, and signature verification requirements.

Errors and retries

Failed requests throw AndoApiError with status, method, path, body, bodyText, and — when the response includes them — code and requestId. The client retries transient failures (429, 5xx, and network errors) up to two times with short fixed delays. Only safe requests retry: GET/HEAD always, other methods only when the request carries an Idempotency-Key header.