Email SDK
Get started

Provider credentials

Configure adapter credentials in the server environment and verify required values with the CLI.

Credentials belong in the server process that constructs the adapter. Email SDK does not read a universal configuration file or expose credentials to browser code.

Required environment variables

Run the adapter catalog to see the names required by the bundled CLI.

npx email-sdk adapters

Common adapters use these values:

AdapterRequired environment variables
ResendRESEND_API_KEY
PostmarkPOSTMARK_SERVER_TOKEN
SendGridSENDGRID_API_KEY
AWS SESAWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION
MailgunMAILGUN_API_KEY, MAILGUN_DOMAIN
CloudflareCLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID
SMTPSMTP_HOST; auth also uses SMTP_USER and SMTP_PASS

The adapter pages list every credential and adapter-specific option.

Pass credentials to application code

Adapter factories accept credentials explicitly. Environment variable names are a deployment convention rather than a hidden SDK lookup.

src/email.ts
import { resend } from "@opencoredev/email-sdk/resend";

export const resendAdapter = resend({
  apiKey: process.env.RESEND_API_KEY!,
});

Check configuration

doctor checks whether the CLI has enough values to construct the adapter. It does not prove that a credential is accepted by the provider.

RESEND_API_KEY=re_xxx npx email-sdk doctor --adapter resend

Use send --dry-run to validate a full message without network delivery. Use a real send only with an approved test recipient.

SMTP transport security

SMTP auth on a non-secure port requires TLS. The transport upgrades with STARTTLS by default. Set allowInsecureAuth only for a trusted local test server.

Browse adapters

Open the setup page for the provider you use.

CLI doctor

See exact configuration checks and failure modes.

On this page