Email SDK

Email SDK

Send transactional email through 24 adapters with one typed TypeScript SDK.

Install the SDK, add the adapter for your provider, and call email.send(). The message shape stays the same if you switch providers later.

Send your first email

Install the SDK, configure one adapter, and send a message from Node.js or Bun.

Start here

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

export const email = createEmailClient({
  adapters: [resend({ apiKey: process.env.RESEND_API_KEY! })],
});

Now call email.send({ from, to, subject, text }). Add retries, fallback, plugins, and more adapters only when you need them.

Included

  • 23 provider API adapters plus SMTP, 24 adapters total
  • Typed adapter names in send, validate, adapter, and withAdapter
  • Retries on the current adapter, then fallback only when delivery is known to have failed
  • Independent sendMany calls and personalized sendPersonalized delivery
  • Hooks, middleware, built-in plugins, and no-network test adapters
  • Provider-native scheduled sends with sendAt
  • CLI commands for adapter discovery, setup checks, and validated dry runs
  • Optional approval-gated AI SDK tools for agent workflows

Runtime boundary

Email SDK is ESM-only and server-side. It supports Node.js 20+ and Bun 1.1+. Keep API keys and SMTP credentials out of browser bundles.

Install

Install the SDK and confirm your Node.js or Bun version.

Schedule an email

Use sendAt for provider scheduling, or keep long-running jobs in your own queue.

Choose an adapter

Set a default adapter and select another by its typed name when needed.

Upgrade from 0.x

Replace v0 provider names and send options with v1 adapters and options.

On this page