npm
@nateq/sdk
GitHub
Source and issues
Requirements
Node.js 18 or newer.Install
Quickstart
Create an API key with theemails:send scope, then put it in your environment:
Authentication
The SDK readsNATEQ_API_KEY by default. Pass it explicitly to load it from a
secret manager, or to talk to more than one organization:
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.
htmlBody, plainTextBody, or both. Omit fromEmail and
emailAddressId to use your organization’s default verified address.
Reading email
limit defaults to 50 and is capped at 100.
Errors
Every error extendsNateqError, 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.