# Email SDK (/docs/v/0.2.1)



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. 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="Send your first email" href="/docs/v/0.2.1/getting-started/quickstart" description="Install the SDK, create a client, and send a message." />

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

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

  <Card title="Read the API reference" href="/docs/v/0.2.1/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.
* 15+ 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.
* 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
[field support guide](/docs/v/0.2.1/adapters/field-support); unsupported fields should fail fast instead of
being silently dropped.
