TypeScript
Changelog
Every release of the package, newest first.
0.0.1
The first release of @nextmail/sdk, the official TypeScript SDK: a typed method for every one of the 548 documented API operations, 684 methods in all once helpers such as listAll and iterate are counted, in 53 namespaces. Every request and response is typed, and the types are exported from the package root. It has no runtime dependencies, ships as ESM and CommonJS, and runs on Node 20+, Bun, Deno and Cloudflare Workers.
- Sending:
emails.sendandsendBatchwith attachments, scheduling, an undo window, tags, open and click tracking and translation,templates.sendfor stored templates, andbroadcasts.sendfor a personalised copy to everybody in an audience. - The mailbox: threads, drafts, labels, signatures, follow-up reminders, out of office replies, rules, the team inbox with assignments and comments, subscriptions, files and the calendar.
- Contacts and marketing: contacts and contact cards, audiences, segments, sign-up forms, broadcasts with A/B tests, automations with contact events, suppressions and unsubscribes.
- The workspace: domains and their DNS records, addresses, members, roles, API keys, webhooks, billing, branding, booking pages, exports, the knowledge base, connected mailboxes, and imports from an old mailbox or another provider.
- The assistant: tasks with their runs and approvals, chats, and connectors to outside apps.
- A workspace API key or an OAuth access token, given to
new Nextmail()or read fromNEXTMAIL_API_KEYorNEXTMAIL_ACCESS_TOKENbycreateNextmail()and the ready madenextmailclient.security.beginStepUpandverifyStepUphandle the verification code a token is asked for before a sensitive change. - Cursor paging: each paged list comes with a
listAllthat reads every page and aniteratethat streams the items and stops whenever you like. - Retries for reads and for calls that are safe to repeat, with backoff after a network failure, a timeout or a server error, and after a rate limit that says when to try again. Sends carry an idempotency key that their retries reuse, so a retried send never goes out twice.
- Two error classes:
NextmailApiError, withstatus,code,param,requestIdand getters such asisValidation,isNotFound,isRateLimitedandisStepUpRequired, andNextmailNetworkError, withisTimeout. verifyWebhookSignaturechecks a webhook delivery in constant time, refuses one more than five minutes old and runs anywhere WebCrypto does, and the data of each of the 51 webhook events is typed.- Disposable inboxes through
createTempMail(), which needs no credential and also runs in a browser. - Every call takes a
signalto cancel it, and a workspace call anapiKeyof its own, so one client can serve several workspaces.raw.request()reaches any endpoint with the client’s credential, base URL, timeout and retries. - The client refuses to start in a browser, where its credential could be read, unless you pass
dangerouslyAllowBrowser, and never sends a credential over plainhttpto another machine.
Google Workspace