Resend
Send email with the Resend API from TypeScript and Node.js: one API key, attachments, tags, scheduled sends, native idempotency keys, and an optional fallback provider.
Capabilities
| Repeated headers | Idempotency | Scheduling | Personalized |
|---|---|---|---|
| No | native |
Yes | expanded |
These values come from the adapter’s exported capabilities declaration. The field support matrix covers normalized message fields.
The Resend adapter calls the Resend Email API with plain fetch. It is the default first adapter in these docs: setup is one API key, field support is broad, and it forwards idempotency keys to the provider as the Idempotency-Key header, so Resend itself deduplicates retried sends.
New to the Resend API itself? The Resend API guide for Node.js and TypeScript walks through raw requests, idempotency keys, rate limits, and webhook signatures before it gets to this adapter.
Choosing a plan? Resend pricing covers the free tier’s daily cap, Pro and Scale, and overage rates.
Connecting over SMTP instead? Resend SMTP settings lists the host, ports and credentials, with a Nodemailer setup.
Moving off Resend? Resend alternatives compares prices and field support, then switches to Amazon SES with Resend kept as the fallback.
Configure
Grab an API key from the Resend dashboard and verify the domain you plan to send from.
A Resend API key starts with re_, and Resend shows it only once, when you create it. Store the whole value, re_ included, as RESEND_API_KEY. A value without that prefix is usually a copy-paste mistake or the key’s ID instead of the key. For an app that only sends, create a sending_access key scoped to your domain. The Resend API guide covers key permissions.
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! })],
});
apiKeystring
Resend API key.
stringbaseUrl?string
Override the API origin, e.g. for a proxy.
string"https://api.resend.com"fetch?typeof fetch
Custom fetch implementation for tests or special runtimes.
typeof fetchheaders?Record<string, string>
Extra HTTP headers sent with every request.
Record<string, string>Send
Resend maps every common transactional field: cc, bcc, replyTo, headers, attachments, and tags. sendAt schedules the send on Resend’s side, transmitted as scheduled_at in ISO 8601 form.
const result = await email.send(
{
from: "Acme <hello@acme.com>",
to: [{ email: "user@example.com", name: "Ada" }],
replyTo: "support@example.com",
subject: "Welcome to Acme",
html: "<p>Your workspace is ready.</p>",
tags: [{ name: "type", value: "welcome" }],
attachments: [
{ filename: "welcome.txt", content: "Welcome to Acme.", contentType: "text/plain" },
],
},
{ idempotencyKey: "welcome:user_123" },
);
console.log(result.id); // Resend email id
The idempotencyKey is sent as Resend’s Idempotency-Key header, so retried requests cannot double-send.
Verify from the CLI
RESEND_API_KEY="re_..." npx --package @opencoredev/email-sdk email-sdk doctor --adapter resend
RESEND_API_KEY="re_..." npx --package @opencoredev/email-sdk email-sdk send \
--adapter resend \
--from "Acme <hello@acme.com>" \
--to user@example.com \
--subject "Resend smoke test" \
--text "It works" \
--dry-run
Drop --dry-run to perform one real send from the environment that will send production email. Local validation cannot tell you whether the account, sender domain, and recipient policy are actually ready; one live send can.
Compare Resend with other providers
Side-by-side message-field support from the SDK capability matrix, with working code for both adapters:
- Resend vs Postmark
- Resend vs SendGrid
- Resend vs AWS SES
- Resend vs Mailgun
- Resend vs Loops
- Resend vs MailerSend
Frequently asked questions
Does Email SDK support Resend?
Yes. Email SDK ships a Resend adapter imported from @opencoredev/email-sdk/resend. You keep your Resend account and credentials; the SDK adds message validation, typed errors, and no-network test adapters around the same send() call used for every other provider.
Which message fields does the Resend adapter support?
Resend supports CC recipients, BCC recipients, Reply-To address, Custom headers, Attachments, Tags, and Scheduled sending (sendAt). It does not support Metadata; Email SDK rejects a message that uses those fields before any request is made.
Can Resend schedule email for later with Email SDK?
Yes. Set sendAt on the message and the Resend adapter passes the scheduled time to the provider.
Does the Resend adapter support idempotent sends?
Yes. The Resend adapter passes an idempotency key to the provider, so Resend deduplicates repeated sends on its side.