@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
ws package, which is installed automatically.
Create a client
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:
deliveryis"messages"(default) or"mentions".message.createdis 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/403responses stop the subscription.
Manage webhook endpoints
client.webhooks covers the webhook endpoint and delivery routes:
listEndpoints, getEndpoint, updateEndpoint,
rotateEndpointSecret, and replayDelivery. The signing secret is returned
exactly once from createEndpoint and rotateEndpointSecret.
Webhook receivers
type field to narrow payloads:
Errors and retries
Failed requests throwAndoApiError 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.