Email SDK

Email SDK

TypeScript email SDK documentation for unified transactional sending across Resend, SMTP, Postmark, SendGrid, Mailgun, AWS SES, and more.

Email SDK is a small TypeScript package for transactional email. It gives your application one client and one message shape while keeping provider-specific behavior visible in the adapter docs.

Use Resend for a simple API path, SMTP when you want a cheap or self-managed route, or another provider when its field support fits your app better. Add plugins for shared defaults, observability, capture, or community adapters. Your application code still calls send; the adapter decides how that message maps to the provider.

What is an email SDK?

An email SDK is a developer library that lets an application send email without hand-writing every provider API request. Email SDK is a TypeScript email SDK focused on transactional email: one typed client, one normalized message shape, and adapters for Resend, SMTP, Postmark, SendGrid, Mailgun, AWS SES, and other providers.

Use Email SDK when you want provider choice without hiding provider limits. Each adapter documents the fields it can send, and unsupported fields fail before the provider request instead of disappearing silently.

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

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

await email.send({
  from: "Acme <hello@acme.com>",
  to: "user@example.com",
  subject: "Welcome",
  text: "Your account is ready.",
});

Start here

What is included

  • createEmailClient for one shared email client.
  • email.send() for one message.
  • email.sendBatch() for small batches where each result is reported separately.
  • 17 adapters, including Resend, SMTP, Postmark, SendGrid, Mailgun, and MailerSend.
  • Retry and fallback options that run in the order you configure.
  • Hooks for logs, metrics, tracing, and retry visibility.
  • Plugins for defaults, observability, capture, community adapters, and reusable send behavior.
  • A small CLI for setup checks, dry runs, and smoke-test sends.
  • A repo-local agent skill for future coding agents.

What stays small

Email SDK does not try to be a template engine, campaign tool, queue, analytics platform, or full email operations suite. It is the layer many apps keep rebuilding: adapter setup, a consistent send call, typed errors, and a fallback path that is explicit enough to debug.

Provider behavior is not hidden

Email providers do not all support the same fields. A fallback route is only safe when the backup adapter can represent the same class of message. Before choosing routes, read the field support guide; unsupported fields should fail fast instead of being silently dropped.

The official API adapters are covered by local payload and validation tests. A live provider send still depends on account setup: verified sender domains, sandbox mode, API scopes, regions, and rate limits. Use the CLI dry run first, then run one real smoke send from the environment that will send production email.

On this page