Migration

Migrate from Resend

eusend's SDK follows Resend's shape on purpose, so for most projects the send path is a client rename and your React Email templates come along untouched. The work is in the edges: webhook verification, tag and tracking defaults, and receiving if you use it. What you gain is an EU-native provider, with mail accepted, stored and delivered on EU infrastructure by a Norwegian company. The European Resend alternative page covers why that matters.

The code change

Install the SDK with npm install @eusend_dev/sdk, swap the import and the environment variable, and keep everything else. emails.send returns the same { data, error } pair, so your error handling stays as it is.

Before · Resend
import { Resend } from 'resend'
import { WelcomeEmail } from './emails/welcome'

const resend = new Resend(process.env.RESEND_API_KEY)

const { data, error } = await resend.emails.send({
  from: 'Acme <hello@acme.com>',
  to: 'user@example.com',
  subject: 'Welcome',
  react: <WelcomeEmail name="Ada" />,
  tags: [{ name: 'category', value: 'welcome' }],
})
After · eusend
import { Eusend } from '@eusend_dev/sdk'
import { WelcomeEmail } from './emails/welcome'

const eusend = new Eusend(process.env.EUSEND_API_KEY)

const { data, error } = await eusend.emails.send({
  from: 'Acme <hello@acme.com>',
  to: 'user@example.com',
  subject: 'Welcome',
  react: <WelcomeEmail name="Ada" />,
  tags: [{ name: 'category', value: 'welcome' }],
})

The SDK renders the react prop locally, so keep react and @react-email/render installed. The JSX never leaves your server; only the rendered HTML is sent.

What carries over unchanged

Field or callOn eusend
from / to / cc / bcc / replyTofrom must use a domain verified in eusend
subject / html / text / reacteusend renders react locally, so keep react and @react-email/render installed
headersA plain object of header names and values
attachmentsfilename plus content or path, optional contentType and contentId. Up to 20 files, 10 MB combined
scheduledAtISO strings or natural language like "in 1 hour", up to 30 days out. emails.update() and emails.cancel() work as before
idempotencyKeyPassed as the second argument: send(payload, { idempotencyKey })
batch.send([...])Up to 100 emails, no attachments. Unlike Resend, a batch item cannot carry scheduledAt; send scheduled emails individually
tagsThe [{ name, value }] array is accepted as-is

What's honestly different

Webhooks

The email event names are the same. What changes is the headers you verify, and Resend has more event types than eusend, so check that nothing you subscribe to is missing.

Resend eventeusend event
email.sentemail.sent
email.deliveredemail.delivered
email.bouncedemail.bounced
email.complainedemail.complained
email.openedemail.opened
email.clickedemail.clicked
email.receivedemail.received
email.failed / email.suppressedemail.failed / email.suppressed. Same names, but compare the payloads in the events reference before reusing a handler
email.delivery_delayedemail.delivery_delayed. Fires once per email, on the first deferral
email.scheduledNo equivalent
contact.updatedcontact.unsubscribed for opt-outs from the unsubscribe page. Other contact changes have no event
contact.created, contact.deleted, domain.*, topic.*, suppression.*No equivalent. Read the state from the API instead

eusend signs every delivery with webhook-id, webhook-timestamp and webhook-signature headers: a base64 HMAC-SHA256 of {id}.{timestamp}.{rawBody}, keyed with your endpoint's secret. Resend's Svix verifier reads different header names, so replace it rather than reusing it, and test the new one against a signed fixture. The webhook security page has a working example; the events reference has every payload.

Receiving email

If you use Resend's inbound, the flow is the same: a webhook tells you a message arrived, and you fetch it. The payload fields are top-level rather than under data, and attachments are fetched by numeric index with eusend.inbound.attachment(id, index). Receiving needs a paid plan.

Before · Resend
// email.received webhook
const { data: email } = await resend.emails.receiving.get(
  event.data.email_id,
)
After · eusend
// email.received webhook — fields are top-level
const { data: email } = await eusend.inbound.get(
  event.inbound_email_id,
)

Moving an existing receiving domain means changing its MX record, so do that last, once the new handler is verified. The receiving docs cover custom domains and the managed address.

Audiences and broadcasts

Resend's segments (formerly audiences) map to eusend audiences, and contacts, topics and broadcasts all exist in eusend. Recreate your segments as audiences, import contacts with their unsubscribe state intact, and create campaigns as drafts so nothing goes out twice. Sending broadcasts needs a paid plan. See audiences and broadcasts.

If you send over SMTP

Anything pointed at Resend's SMTP server moves by swapping the host and credentials. The one catch: eusend uses implicit TLS on port 465, and STARTTLS on 587 is not supported.

nodemailer
// Before: smtp.resend.com, user "resend", API key as password
// After — implicit TLS on 465; STARTTLS on 587 is not supported
const transport = nodemailer.createTransport({
  host: 'smtp.eusend.dev',
  port: 465,
  secure: true,
  auth: { user: 'eusend', pass: process.env.EUSEND_API_KEY },
})

Before you flip production

Want it done for you?
The migration page has a copy-paste prompt that lets an AI coding agent do the whole swap against our live API reference. Or email support@eusend.dev and we'll help you move over.