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.
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' }],
})
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 call | On eusend |
|---|---|
| from / to / cc / bcc / replyTo | from must use a domain verified in eusend |
| subject / html / text / react | eusend renders react locally, so keep react and @react-email/render installed |
| headers | A plain object of header names and values |
| attachments | filename plus content or path, optional contentType and contentId. Up to 20 files, 10 MB combined |
| scheduledAt | ISO strings or natural language like "in 1 hour", up to 30 days out. emails.update() and emails.cancel() work as before |
| idempotencyKey | Passed 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 |
| tags | The [{ name, value }] array is accepted as-is |
What's honestly different
- Tags come back as an object. You can send
[{ name: 'category', value: 'welcome' }], but responses and webhook payloads return{ category: 'welcome' }. Update any code that reads tags out of a webhook. - Tracking is not a domain setting. Resend turns open and click tracking on per domain. eusend has no per-domain switch: tracking follows a workspace default, which starts off, and you can override it per send with
trackOpensandtrackClicks. If you had tracking on in Resend, turn on the workspace default or set it per send. See tracking. - Check each batch result. An invalid payload still rejects the whole request. Once it is accepted, each item in
batch.sendgets its own result:{ id }when queued, or{ error, code }when that one email could not be, for example because every recipient is suppressed. Check each item for anid. - Bring your suppression list. eusend suppresses hard bounces and complaints automatically, but it cannot see Resend's history. Export your suppressions and import them before the first send, so addresses that already bounced are not tried again from a new IP.
- Hosted templates need porting. React Email templates in your codebase need no change. Templates stored in Resend need their subject and body recreated in eusend; variables use HTML-escaped
{{variable}}syntax. See templates.
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 event | eusend event |
|---|---|
| email.sent | email.sent |
| email.delivered | email.delivered |
| email.bounced | email.bounced |
| email.complained | email.complained |
| email.opened | email.opened |
| email.clicked | email.clicked |
| email.received | email.received |
| email.failed / email.suppressed | email.failed / email.suppressed. Same names, but compare the payloads in the events reference before reusing a handler |
| email.delivery_delayed | email.delivery_delayed. Fires once per email, on the first deferral |
| email.scheduled | No equivalent |
| contact.updated | contact.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.
// email.received webhook
const { data: email } = await resend.emails.receiving.get(
event.data.email_id,
)
// 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.
// 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
- Add your sending domain on the Domains page and publish its DKIM records. Resend and eusend can both hold the domain at once. eusend needs no SPF record on your root domain, so leave your existing one alone; the DNS records page explains why.
- Run the migration against an
eu_test_key first. Test sends are accepted and logged but never delivered. Then switch toeu_live_. - Keep your Resend account for a week or two after cutover, so in-flight webhooks and your suppression export still have somewhere to come from.