# Email SDK (/docs/v/0.3.0)



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.

```ts
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 [#start-here]

<Cards>
  <Card title="Install package and CLI" href="/docs/v/0.3.0/getting-started/install" description="Use the scoped npm package and the email-sdk command." />

  <Card title="Send your first email" href="/docs/v/0.3.0/getting-started/quickstart" description="Install the SDK, create a client, and send a message." />

  <Card title="Understand adapters" href="/docs/v/0.3.0/concepts/adapter-model" description="Learn how adapters and routing names work." />

  <Card title="Browse adapters" href="/docs/v/0.3.0/adapters" description="See all supported email services." />

  <Card title="Use plugins" href="/docs/v/0.3.0/plugins" description="Add defaults, observability, capture, adapter plugins, and reusable send behavior." />

  <Card title="Build an adapter" href="/docs/v/0.3.0/guides/authoring/create-adapter" description="Write your first custom provider adapter and package it for reuse." />

  <Card title="Read the API reference" href="/docs/v/0.3.0/reference/client" description="Look up client options, messages, errors, and the CLI." />
</Cards>

## What is included [#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.
* Fifteen 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 [#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 [#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 <a href="/docs/v/0.3.0/adapters/field-support">field support guide</a>; unsupported fields should fail fast instead of being silently dropped.
