Skip to content
You're viewing documentation for v0.6.5. It may be out of date.Go to latest
Email SDK
Esc
↑↓navigate↵open⌘Jpreview
On this page

Authentication

How Email SDK authenticates to every provider. There is no platform account; you supply each provider's own credential from an environment variable.

Email SDK is a library, not a hosted service. There is no Email SDK account, API key, or OAuth flow. You authenticate to each email provider with that provider’s own credential, which you read from an environment variable and pass to the adapter. The adapter sets the provider’s required auth header (or signs the request) for you.

How credentials flow

Each adapter is imported from its own entry point (@opencoredev/email-sdk/<name>) and takes the fields that provider needs. Most providers use a single API key; a few add a routing id, use a key pair, or sign requests.

Credential by provider

Provider Import Credential model Required config → environment variable
Resend @opencoredev/email-sdk/resend API key apiKey → RESEND_API_KEY
Postmark @opencoredev/email-sdk/postmark Server token serverToken → POSTMARK_SERVER_TOKEN
SendGrid @opencoredev/email-sdk/sendgrid API key apiKey → SENDGRID_API_KEY
Cloudflare @opencoredev/email-sdk/cloudflare API token + account apiToken → CLOUDFLARE_API_TOKEN, accountId → CLOUDFLARE_ACCOUNT_ID
Unosend @opencoredev/email-sdk/unosend API key apiKey → UNOSEND_API_KEY
AWS SES @opencoredev/email-sdk/ses Access key pair (SigV4) accessKeyId → AWS_ACCESS_KEY_ID, secretAccessKey → AWS_SECRET_ACCESS_KEY, region → AWS_REGION (optional sessionToken → AWS_SESSION_TOKEN)
Mailgun @opencoredev/email-sdk/mailgun API key + domain apiKey → MAILGUN_API_KEY, domain → MAILGUN_DOMAIN
MailerSend @opencoredev/email-sdk/mailersend API key apiKey → MAILERSEND_API_KEY
Brevo @opencoredev/email-sdk/brevo API key apiKey → BREVO_API_KEY
Mailchimp Transactional @opencoredev/email-sdk/mailchimp API key apiKey → MAILCHIMP_API_KEY
SparkPost @opencoredev/email-sdk/sparkpost API key apiKey → SPARKPOST_API_KEY
Iterable @opencoredev/email-sdk/iterable API key + campaign apiKey → ITERABLE_API_KEY, campaignId → ITERABLE_CAMPAIGN_ID
Loops @opencoredev/email-sdk/loops API key + transactional id apiKey → LOOPS_API_KEY, transactionalId → LOOPS_TRANSACTIONAL_ID
Sequenzy @opencoredev/email-sdk/sequenzy API key apiKey → SEQUENZY_API_KEY
JetEmail @opencoredev/email-sdk/jetemail API key apiKey → JETEMAIL_API_KEY
Lettermint @opencoredev/email-sdk/lettermint API token apiToken → LETTERMINT_API_TOKEN
Primitive @opencoredev/email-sdk/primitive API key apiKey → PRIMITIVE_API_KEY
Plunk @opencoredev/email-sdk/plunk API key apiKey → PLUNK_API_KEY
Mailtrap @opencoredev/email-sdk/mailtrap API key apiKey → MAILTRAP_API_KEY
Scaleway @opencoredev/email-sdk/scaleway Project id + secret key projectId → SCALEWAY_PROJECT_ID, secretKey → SCALEWAY_SECRET_KEY (optional region, defaults to fr-par)
ZeptoMail @opencoredev/email-sdk/zeptomail Send-mail token token → ZEPTOMAIL_TOKEN
MailPace @opencoredev/email-sdk/mailpace API key apiKey → MAILPACE_API_KEY
SMTP @opencoredev/email-sdk/smtp SMTP username + password host, port, secure, auth: { user, pass } → SMTP_USER, SMTP_PASS

Each provider page under Adapters links to where that credential is issued and lists every configuration field.

SMTP

SMTP is the one adapter that does not take an API key. It connects to a mail server with a host, port, and username/password. The SDK ships its own SMTP transport, so you do not add Nodemailer.

Optional configuration

Beyond credentials, the HTTP-based adapters accept two shared optional fields:

  • baseUrl overrides the provider’s API origin, for a proxy or region endpoint.
  • fetch injects a custom fetch implementation for tests or special runtimes.

A few adapters (Resend, Postmark, JetEmail, Lettermint, Primitive) also take a headers option for extra HTTP request headers. SMTP is socket-based and has its own options (host, port, secure, tls, and so on) instead of these. Each adapter page lists its exact option set.

Multiple providers and fallbacks

Pass several configured adapters to route across them. Only configure a fallback between adapters that support the same fields; see Field support.

Keeping credentials safe

  • Scope each provider key to sending only, where the provider supports it.
  • Rotate or revoke credentials in the provider’s own dashboard, then update the environment variable. Email SDK holds no session or token state of its own.
  • Use idempotency keys for externally visible sends that may be retried.

Per-provider setup

SponsorLive check available
Postmark logo
Postmark

Great for focused transactional email and deliverability.

SendGrid logo
SendGrid

Best when your product already runs on Twilio SendGrid.

AWS SES logo
AWS SES

A good fit for AWS teams sending at high volume.

Mailgun logo
Mailgun

Use with an existing Mailgun setup or sending domain.

MailerSend logo
MailerSend

A simple API with a friendly dashboard for growing teams.

Brevo logo
Brevo

Use transactional email alongside your Brevo marketing stack.

Mailchimp Transactional logo
Mailchimp Transactional

Best for products already using Mailchimp Transactional.

SparkPost logo
SparkPost

Use when SparkPost already powers your email delivery.

Mailtrap logo
Mailtrap

Useful when testing and production email live in Mailtrap.

Cloudflare Email Sending logo
Cloudflare Email Sending

Send directly from apps running on Cloudflare Workers.

Scaleway logo
Scaleway

A natural fit for apps hosted in the Scaleway ecosystem.

ZeptoMail logo
ZeptoMail

Use transactional email alongside Zoho and ZeptoMail.

MailPace logo
MailPace

A simple transactional email API for smaller products.

Loops logo
Loops

Send product and lifecycle email through your Loops account.

Plunk logo
Plunk

An open-source-friendly option for product email.

SMTP
SMTP

Connect any existing SMTP server or self-hosted mail system.

Verify your sending domain’s DNS

API credentials get the request accepted; SPF, DKIM, and DMARC records get the mail delivered. After verifying a domain with your provider, confirm the records actually resolve with the free email DNS checker — it validates SPF syntax and lookup limits, probes common DKIM selectors, and checks your DMARC policy.

Last updated on