Email SDK
Adapters

Resend

Configure the fetch-based Resend adapter.

The Resend adapter calls the Resend Email API directly. It does not add a runtime dependency.

Resend logo
Resend
email-sdk/resend
import { createEmailClient } from "email-sdk";
import { resend } from "email-sdk/resend";

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

Send

await email.send(
  {
    from: "Acme <hello@acme.com>",
    to: "user@example.com",
    subject: "Welcome",
    html: "<p>Your workspace is ready.</p>",
    tags: [{ name: "type", value: "welcome" }],
  },
  {
    idempotencyKey: "welcome:user_123",
  },
);

Options

OptionTypeRequiredNotes
apiKeystringYesResend API key.
baseUrlstringNoDefaults to https://api.resend.com.
fetchtypeof fetchNoUseful for tests or custom runtimes.
headersRecord<string, string>NoExtra request headers.

Response

The adapter returns the Resend id as id and messageId.

On this page