The official pristinesend package is the fastest way to call the API from Node or TypeScript. It encodes the whole contract — typed methods and errors, an auto-paginating cursor iterator, automatic idempotency on sends, retry/backoff, and a react: convenience for React Email. ESM + CJS, no required dependencies.
Pass your API key. A ps_test_ key runs in the sandbox (captured, not delivered).
Idempotency is automatic:
Pass a React Email component as react; the SDK lazily imports @react-email/render and sends the rendered HTML.
HTML-only for now: the API has no text field yet, so React Email's plaintext alternative is dropped. The SDK will send it automatically once the field lands.
Every list() returns a page that auto-paginates when iterated — see Pagination.
Every failure is a typed subclass of PristineSendError carrying the API's code, the offending param, and the requestId to quote to support. See Error codes.
The client retries up to maxRetries times (default 2) on 429, 502, 503, and network errors, honoring Retry-After with exponential backoff. See Rate limits.
| Method | Description |
|---|---|
emails.send(params) | Send one email. Pass html or react:. |
emails.sendBatch(params) | Send up to 100 (207 per-item result). |
emails.get(id) | Retrieve one sent email. |
emails.list(params?) | List sent emails (auto-paginating). |
contacts.create(params) | Create a contact. |
contacts.get(id) | Retrieve a contact. |
contacts.update(id, params) | Update a contact (merges properties). |
contacts.delete(id) | Delete a contact. |
contacts.list(params?) | List contacts (auto-paginating). |
domains.list(params?) | List verified sending domains. |
suppressions.create(params) | Add an email to the do-not-send list. |
suppressions.delete(params) | Remove an email (pass force to lift a bounce/complaint). |
suppressions.list(params?) | List suppressions. |
events.list(params?) | List the webhook delivery log. |
deliverability.check(params) | Score content before sending. Sends nothing. |
segments.create(params) | Build an audience from a filter; returns its recipient count. |