Skip to the documentation
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.send and sendBatch with attachments, scheduling, an undo window, tags, open and click tracking and translation, templates.send for stored templates, and broadcasts.send for 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 from NEXTMAIL_API_KEY or NEXTMAIL_ACCESS_TOKEN by createNextmail() and the ready made nextmail client. security.beginStepUp and verifyStepUp handle the verification code a token is asked for before a sensitive change.
  • Cursor paging: each paged list comes with a listAll that reads every page and an iterate that 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, with status, code, param, requestId and getters such as isValidation, isNotFound, isRateLimited and isStepUpRequired, and NextmailNetworkError, with isTimeout.
  • verifyWebhookSignature checks 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 signal to cancel it, and a workspace call an apiKey of 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 plain http to another machine.