Skip to main content
The quickest way to send email from Node.js is the official SDK, @xem.email/sdk. For anything the SDK does not cover yet, such as analytics, call the API directly with fetch. Both need an API key. Create one in Settings → API keys and keep it in an environment variable, never in code.

Install

Send an email

Xem queues the email in your workspace outbox and sends it through your default sender.

Send a saved template

Schedule, reply-to and test sends

Self-hosted installs

Point the SDK at your own API:

Call the API with fetch

Every endpoint accepts the API key in the X-API-Key header. This example sends an email with a requestId, so a retry after a network error cannot send it twice:
Reusing a requestId for a different message returns 409.

Read campaign analytics

See the API reference for the full list of endpoints and response fields.

Handle errors

See Error handling and Rate limiting for details.