Skip to main content
The official Node.js client for the Nateq API. TypeScript-first, ships both ESM and CommonJS, and has zero runtime dependencies.

npm

@nateq/sdk

GitHub

Source and issues

Requirements

Node.js 18 or newer.

Install

Quickstart

Create an API key with the emails:send scope, then put it in your environment:

Authentication

The SDK reads NATEQ_API_KEY by default. Pass it explicitly to load it from a secret manager, or to talk to more than one organization:
The key is validated locally before any request, so a mistyped key fails immediately rather than going out over the network.
The client holds your API key, so never render it. console.log, JSON.stringify, and util.inspect all redact it — but don’t defeat that by logging the key directly.

Sending email

send() resolves once the API accepts the message. Delivery happens afterwards — a resolved promise means Nateq took responsibility for it, not that it landed.
Provide htmlBody, plainTextBody, or both. Omit fromEmail and emailAddressId to use your organization’s default verified address.

Reading email

List sends, newest first:
limit defaults to 50 and is capped at 100.

Errors

Every error extends NateqError, so one catch covers the surface:
See Errors for the underlying API codes.

Retries and duplicate sends

Reads (get, list) retry automatically on timeouts, 5xx, and connection failures, with exponential backoff that honours Retry-After. send() does not. The API has no idempotency key, so a send that fails after reaching the server may already have gone out. Replaying it could mail your customer twice, and the SDK won’t make that call for you. The exception is a 429, which the API raises before anything is sent — so it is retried, because a duplicate is impossible. If a send() throws NateqTimeoutError or NateqServerError, the outcome is genuinely unknown. Look it up before retrying:

Configuration

baseUrl must be https, unless it points at localhost for local development.

Framework usage

Construct the client once and reuse it. It’s stateless and safe to share.
Sending inside a request ties your response time to ours. For anything non-critical, send from a background job or queue instead.