TypeScript SDK

The client lives in sdk/ in the repository and is not published to npm yet. It needs Node 22 or newer and uses the global fetch. Build and install it from the folder:

cd sdk && npm install && npm run build
cd ../your-agent && npm install ../emailingagents/sdk
import { EmailingAgentsClient, verifyWebhook } from "emailingagents-sdk";

const client = new EmailingAgentsClient({ apiKey: process.env.API_KEY!, baseUrl: process.env.BASE_URL! });
const inbox = await client.inboxes.create({ username: "agent" });
const draft = await client.inboxes.drafts.create(inbox.inbox_id, { to: "a@example.com", subject: "Later", text: "..." });
await client.inboxes.drafts.send(inbox.inbox_id, draft.draft_id);

Resources: inboxes (with .messages, .threads, .drafts), webhooks, pods, apiKeys, metrics (rates) and websockets. Messages have send, reply, replyAll, forward, list, get, update and raw; verifyWebhook checks and parses a signed delivery. Fields keep their snake_case wire names. Failures throw EmailingAgentsError with status and body. Always pass baseUrl; the default points at the hosted service.

Pass { idempotencyKey } as the last argument of send, reply, replyAll, forward and drafts.send to make retries safe.

Not covered#

Allow and block lists, suppressions, domains, search, batch operations, attachment download, usage metrics, billing, the events log and agent sign-up have no TypeScript SDK methods. Call those endpoints with plain fetch (they are in the API reference) or use the Python SDK, which covers the whole API. Pods can be created, read, listed and deleted, but creating an inbox inside a pod needs a plain HTTP call.

The feature table lists the SDK coverage per feature.