---
title: "Resend"
description: "Set up Resend for email: the account, the API key, the sending domain and its DNS records, the region, sending subdomains and the webhook."
canonical_url: "https://nuxt-backend.dev/docs/services/resend"
---
# Resend

> Set up Resend for email: the account, the API key, the sending domain and its DNS records, the region, sending subdomains and the webhook.

Version: nuxt-backend 0.6.x · Tab: Services · Kind: how-to · Status: stable

Every page: [llms.txt](https://nuxt-backend.dev/llms.txt) · Skill for coding agents: [nuxt-backend](https://nuxt-backend.dev/.well-known/skills/nuxt-backend/SKILL.md)

Commands use npm; use your project's package manager.

Resend sends every email the app writes and reports what happened to it. You need it for sign-in codes beyond your terminal. Its free plan covers development.

<table>
<thead>
  <tr>
    <th>
      You need
    </th>
    
    <th>
      Time
    </th>
    
    <th>
      Cost to start
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      A Resend account, and a domain you can add DNS records to before launch
    </td>
    
    <td>
      10 minutes, plus up to a day for DNS
    </td>
    
    <td>
      Free: 3,000 emails a month
    </td>
  </tr>
</tbody>
</table>

## What it powers

<table>
<thead>
  <tr>
    <th>
      Capability
    </th>
    
    <th>
      What Resend gives
    </th>
    
    <th>
      Build pages
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        auth
      </code>
    </td>
    
    <td>
      Delivery of sign-in codes, invitations and new-sign-in alerts
    </td>
    
    <td>
      <a href="https://nuxt-backend.dev/docs/build/auth/sign-in">
        Sign users in
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        email
      </code>
    </td>
    
    <td>
      Sending, delivery events, suppressions and idempotency keys
    </td>
    
    <td>
      <a href="https://nuxt-backend.dev/docs/build/email/sending">
        Send transactional email
      </a>
      
      , <a href="https://nuxt-backend.dev/docs/build/email/delivery">
        Track delivery
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        email
      </code>
    </td>
    
    <td>
      Contacts, topics and segments, the base of the preference center
    </td>
    
    <td>
      <a href="https://nuxt-backend.dev/docs/build/email/preferences">
        Let people choose their emails
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        email
      </code>
    </td>
    
    <td>
      Automations, the engine behind lifecycle emails
    </td>
    
    <td>
      <a href="https://nuxt-backend.dev/docs/build/growth/engage/lifecycle-emails">
        Send lifecycle emails
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        email
      </code>
    </td>
    
    <td>
      Receiving, for a support inbox and the contact form
    </td>
    
    <td>
      <a href="https://nuxt-backend.dev/docs/build/email/inbound">
        Receive email
      </a>
    </td>
  </tr>
</tbody>
</table>

Until you add a key, sign-in still works in development: codes print in the terminal running `npx nuxt-backend dev`.

## Create the account

<steps level="3">

### Sign up, once per stage

Sign up at [resend.com](https://resend.com/signup). One login can belong to several teams, and each team has its own keys, domains, quota and webhooks. Create one team for production and one for development and demos: a team's webhook receives the events of every email the team sends, so a shared team mixes test events into production's.

### Create an API key

In the team's dashboard, open **API Keys** and create a key with **Full access**. The package's `email sync` creates topics, segments and the webhook, and `doctor` reads the domain's status, which a **Sending access** key cannot do. Copy the key: Resend shows it once ([Create an API key](https://resend.com/docs/create-an-api-key)).

### Add the sending domain

Open **Domains**, **Add Domain**, and enter a subdomain of yours, such as `mail.example.com`. Pick the region it sends from: `us-east-1`, `eu-west-1`, `sa-east-1` or `ap-northeast-1`. A domain keeps its region: changing it means removing the domain and adding it again ([Regions](https://resend.com/docs/dashboard/domains/regions)).

### Publish the DNS records

Add the records Resend shows at your DNS host:

<table>
<thead>
  <tr>
    <th>
      Record
    </th>
    
    <th>
      Name
    </th>
    
    <th>
      What it proves
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      TXT
    </td>
    
    <td>
      <code>
        resend._domainkey
      </code>
    </td>
    
    <td>
      DKIM: the mail is signed by your domain
    </td>
  </tr>
  
  <tr>
    <td>
      MX and TXT
    </td>
    
    <td>
      <code>
        send
      </code>
      
      , under the domain
    </td>
    
    <td>
      SPF and bounces, on the Return-Path subdomain
    </td>
  </tr>
  
  <tr>
    <td>
      TXT
    </td>
    
    <td>
      <code>
        _dmarc
      </code>
      
      , added by you
    </td>
    
    <td>
      DMARC: what receivers do with mail that fails the two above
    </td>
  </tr>
</tbody>
</table>

Resend verifies most domains within 15 minutes, and within 72 hours at most ([Add a domain](https://resend.com/docs/add-a-domain)). Start with DMARC at `p=none`, then move it to `quarantine` once reports look clean ([Get email into inboxes](https://nuxt-backend.dev/docs/build/email/delivery/deliverability)).

</steps>

**Who should own it.** The production team belongs to whoever owns the domain's DNS. Invite developers to the development team; few people need the production one.

**Subdomains.** Send from subdomains, never the root domain, so their reputation stays apart from your company mail. Use one for transactional mail (`EMAIL_FROM`, such as `codes@mail.example.com`) and, once you send newsletters, another for marketing (`EMAIL_MARKETING_FROM`, such as `news@news.example.com`) ([Resend on subdomains](https://resend.com/docs/knowledge-base/is-it-better-to-send-emails-from-a-subdomain-or-the-root-domain)).

## Sandbox and test mode

Resend has no separate sandbox. The package keeps email in test mode outside production: it sends only to Resend's test addresses, which accept mail without delivering it and send real delivery events back.

<table>
<thead>
  <tr>
    <th>
      <code>
        BACKEND_ENVIRONMENT
      </code>
    </th>
    
    <th>
      What the package sends
    </th>
    
    <th>
      Sign-in codes
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        development
      </code>
    </td>
    
    <td>
      Test addresses only
    </td>
    
    <td>
      Also printed in the terminal
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        preview
      </code>
      
      , <code>
        sandbox
      </code>
    </td>
    
    <td>
      Test addresses only
    </td>
    
    <td>
      Not printed
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        production
      </code>
    </td>
    
    <td>
      Every address
    </td>
    
    <td>
      Not printed
    </td>
  </tr>
</tbody>
</table>

<table>
<thead>
  <tr>
    <th>
      Address
    </th>
    
    <th>
      What Resend does
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        delivered@resend.dev
      </code>
    </td>
    
    <td>
      Delivers it, and sends <code>
        email.delivered
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        bounced@resend.dev
      </code>
    </td>
    
    <td>
      Rejects it, and sends <code>
        email.bounced
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        complained@resend.dev
      </code>
    </td>
    
    <td>
      Delivers it as spam, and sends <code>
        email.complained
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        suppressed@resend.dev
      </code>
    </td>
    
    <td>
      Suppresses it, as for an address that bounced before
    </td>
  </tr>
</tbody>
</table>

All but `suppressed@` take a `+label`, such as `delivered+signup@resend.dev`. Test sends count against your quota. Before your domain is verified, `onboarding@resend.dev` works as the sender, to your own address only ([Send test emails](https://resend.com/docs/dashboard/emails/send-test-emails)). `npx nuxt-backend inbox` reads what was sent ([Read test mail in the dev inbox](https://nuxt-backend.dev/docs/develop/dev-inbox)).

## Keys and environment

<table>
<thead>
  <tr>
    <th>
      Variable
    </th>
    
    <th>
      Where to find it
    </th>
    
    <th>
      Dev
    </th>
    
    <th>
      Prod
    </th>
    
    <th>
      Secret
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        EMAIL_API_KEY
      </code>
    </td>
    
    <td>
      <strong>
        API Keys
      </strong>
      
      , a full-access key of that stage's team
    </td>
    
    <td>
      The development team's key
    </td>
    
    <td>
      The production team's key
    </td>
    
    <td>
      Yes
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        EMAIL_FROM
      </code>
    </td>
    
    <td>
      An address on your verified domain, alone or as <code>
        Name <address>
      </code>
    </td>
    
    <td>
      <code>
        onboarding@resend.dev
      </code>
      
       until the domain verifies
    </td>
    
    <td>
      <code>
        Panels <codes@mail.example.com>
      </code>
    </td>
    
    <td>
      No
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        EMAIL_MARKETING_FROM
      </code>
    </td>
    
    <td>
      An address on the marketing subdomain
    </td>
    
    <td>
      Optional
    </td>
    
    <td>
      Needed once you send newsletters
    </td>
    
    <td>
      No
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        EMAIL_WEBHOOK_SECRET
      </code>
    </td>
    
    <td>
      The webhook's signing secret, <code>
        whsec_…
      </code>
      
      . <code>
        email sync
      </code>
      
       stores it
    </td>
    
    <td>
      Stored by the sync
    </td>
    
    <td>
      Stored by the sync
    </td>
    
    <td>
      Yes
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        EMAIL_REGION
      </code>
    </td>
    
    <td>
      The region you picked for the domain
    </td>
    
    <td>
      Optional
    </td>
    
    <td>
      The domain's region
    </td>
    
    <td>
      No
    </td>
  </tr>
</tbody>
</table>

All of them live on the Convex deployment. `EMAIL_REGION` records the region the domain sends from; Resend picks the region by the domain, so the value must match it.

## Link it

<steps level="3">

### Push the key and the sender

```bash [.env.local]
EMAIL_API_KEY=re_your_development_key
EMAIL_FROM=onboarding@resend.dev
```

```bash
npx nuxt-backend env push
```

### Sync topics, segments and the webhook

```bash
npx nuxt-backend email sync
```

It creates the topics, the segment and the contact properties `backend/email.ts` declares, and the lifecycle automations you turned on. It paces its calls to the rate limit Resend names on each answer, and waits out a call Resend refuses with `429`, so a key on a low limit makes a slower sync, not a failed one. It points a webhook at the deployment's `/email/events` with every event the package reads, and stores the signing secret as `EMAIL_WEBHOOK_SECRET` ([`email sync`](https://nuxt-backend.dev/docs/reference/cli#email-sync)). A local deployment needs a tunnel: pass its URL with `--webhook https://your-tunnel-host/email/events`.

### Send yourself a test

Sign in with `delivered+you@resend.dev`, then run `npx nuxt-backend inbox`: the code is there.

</steps>

Then run [`npx nuxt-backend email sync`](https://nuxt-backend.dev/docs/reference/cli#email-sync): it points a webhook at `https://<slug>.convex.site/email/events` with every event the package reads, and stores its signing secret on the deployment as `EMAIL_WEBHOOK_SECRET`. To do it by hand instead, add the endpoint in **Webhooks**, copy its signing secret to `.env.local` as `EMAIL_WEBHOOK_SECRET`, and run `npx nuxt-backend env push`.

## Check it

```bash
npx nuxt-backend doctor --only email
```

<table>
<thead>
  <tr>
    <th>
      Finding
    </th>
    
    <th>
      What it checks
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <a href="https://nuxt-backend.dev/docs/reference/cli/diagnostics#email-transport">
        <code>
          email-transport
        </code>
      </a>
      
      , <a href="https://nuxt-backend.dev/docs/reference/cli/diagnostics#deployment-email-api-key">
        <code>
          deployment-email-api-key
        </code>
      </a>
    </td>
    
    <td>
      A key is set, and Resend accepts it
    </td>
  </tr>
  
  <tr>
    <td>
      <a href="https://nuxt-backend.dev/docs/reference/cli/diagnostics#deployment-email-from">
        <code>
          deployment-email-from
        </code>
      </a>
    </td>
    
    <td>
      The deployment has a sender
    </td>
  </tr>
  
  <tr>
    <td>
      <a href="https://nuxt-backend.dev/docs/reference/cli/diagnostics#email-webhook-secret">
        <code>
          email-webhook-secret
        </code>
      </a>
      
      , <a href="https://nuxt-backend.dev/docs/reference/cli/diagnostics#email-webhook-route">
        <code>
          email-webhook-route
        </code>
      </a>
    </td>
    
    <td>
      Delivery events reach the deployment and pass the signature check
    </td>
  </tr>
  
  <tr>
    <td>
      <a href="https://nuxt-backend.dev/docs/reference/cli/diagnostics#email-sender-domain">
        <code>
          email-sender-domain
        </code>
      </a>
    </td>
    
    <td>
      Under <code>
        --prod
      </code>
      
      : the sender's domain is verified
    </td>
  </tr>
  
  <tr>
    <td>
      <a href="https://nuxt-backend.dev/docs/reference/cli/diagnostics#email-reputation">
        <code>
          email-reputation
        </code>
      </a>
      
      , <a href="https://nuxt-backend.dev/docs/reference/cli/diagnostics#email-quota">
        <code>
          email-quota
        </code>
      </a>
    </td>
    
    <td>
      Under <code>
        --prod
      </code>
      
      : last week's bounces and complaints, and the quota left
    </td>
  </tr>
</tbody>
</table>

## Go to production

<steps level="3">

### Verify the production domain

Add it to the production team, publish its records, and wait for **Verified**.

### Set production's key and sender

```bash
npx convex env set --prod EMAIL_API_KEY
printf %s 'Panels <codes@mail.example.com>' | npx convex env set --prod EMAIL_FROM
```

### Sync and check

With the production `CONVEX_DEPLOY_KEY` and key in your shell:

```bash
npx nuxt-backend email sync --prod
npx nuxt-backend doctor --prod
```

</steps>

Leave the free plan before launch: its 100 emails a day can run out on launch day, and every sign-in code is an email. `doctor --prod` warns while the account has a daily quota.

## Costs and limits

Checked on 2026-10-25 against [Resend pricing](https://resend.com/pricing) and its [limits](https://resend.com/docs/knowledge-base/account-quotas-and-limits):

<table>
<thead>
  <tr>
    <th>
      
    </th>
    
    <th>
      Free
    </th>
    
    <th>
      Pro
    </th>
    
    <th>
      Scale
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      Price
    </td>
    
    <td>
      $0
    </td>
    
    <td>
      $20 a month for 50,000 emails, $35 for 100,000
    </td>
    
    <td>
      From $90 a month for 100,000 emails
    </td>
  </tr>
  
  <tr>
    <td>
      Daily cap
    </td>
    
    <td>
      100 emails
    </td>
    
    <td>
      None
    </td>
    
    <td>
      None
    </td>
  </tr>
  
  <tr>
    <td>
      Domains
    </td>
    
    <td>
      3
    </td>
    
    <td>
      10
    </td>
    
    <td>
      1,000
    </td>
  </tr>
  
  <tr>
    <td>
      Webhook endpoints
    </td>
    
    <td>
      1
    </td>
    
    <td>
      5
    </td>
    
    <td>
      10
    </td>
  </tr>
</tbody>
</table>

- **Marketing email** is priced by contacts: free up to 1,000, then from $40 a month for 5,000.
- **Rate limit:** 10 requests a second per team, shared by every key. Support can raise it ([Rate limit](https://resend.com/docs/api-reference/rate-limit)).
- **Overage** on paid plans costs $0.90 to $0.46 per 1,000 emails, capped at five times your quota.
- **Webhooks:** Resend retries a failed delivery for about a day and a half, then disables an endpoint that keeps failing and emails the team. `doctor` reports a disabled one.
- **Idempotency keys** last 24 hours: a send retried with the same key goes out once.

## Data and compliance

- **What it holds:** every recipient's address, each email's content, its delivery events, and contacts with their topic choices.
- **Region:** mail leaves from the domain's region, but Resend stores all account data in the US, whichever region you send from. Forge, Resend's own mail server, runs in `us-east-1` only ([Forge](https://resend.com/docs/forge)).
- **Retention:** email content, events and logs are kept for 30 days on every plan.
- **Role:** Resend processes data on your behalf. Its [DPA](https://resend.com/legal/dpa) covers GDPR, and it lists its [subprocessors](https://resend.com/legal/subprocessors), all in the US. It holds SOC 2 Type II ([Security](https://resend.com/docs/security)).
- **Erasure:** deleting an account removes its Resend contact too ([Export and delete an account](https://nuxt-backend.dev/docs/build/auth/accounts/data)).

Name Resend in your privacy policy as a processor that transfers data to the US ([Privacy, GDPR and cookies](https://nuxt-backend.dev/docs/ship/compliance/privacy)). Email law has its own page: [Follow email law](https://nuxt-backend.dev/docs/ship/compliance/email-law). This is not legal advice.

## Related

- [Send transactional email](https://nuxt-backend.dev/docs/build/email/sending): `email.send` and the templates.
- [Get email into inboxes](https://nuxt-backend.dev/docs/build/email/delivery/deliverability): DMARC, reputation and warm-up.
- [Read test mail in the dev inbox](https://nuxt-backend.dev/docs/develop/dev-inbox): codes and invitations without a mailbox.
- [Register webhooks](https://nuxt-backend.dev/docs/ship/security/webhooks): how deliveries are verified.
- [Service map](https://nuxt-backend.dev/docs/services): every service, and the order to set them up in.


## Sitemap

See the full [sitemap](https://nuxt-backend.dev/sitemap.md) for all pages.
