Resend
Email adapter for Chat SDK powered by Resend. Receive inbound emails via webhooks, send rich HTML replies, and proactively start email threads with `openDM`.
Create a new bot
Scaffold a Next.js bot with the Resend adapter using create-chat-sdk:
pnpm create chat-sdk@latest my-bot --adapter resend memory -yThe generated app uses the Memory state adapter for local development. To add the adapter to an existing app, start at Install.
Install
pnpm add @resend/chat-sdk-adapter chat @chat-adapter/sharedQuick start
Forward Resend webhooks to your server's webhook endpoint. The adapter verifies signatures and routes events into the Chat SDK handler pipeline. See the examples/basic folder in the adapter repo for a full working server.
Configuration
| Prop | Type | Description |
|---|---|---|
fromAddress? | string | Sender email address. Required. |
fromName? | string | Display name used in the From header. |
apiKey? | string | Resend API key. Auto-detected from `RESEND_API_KEY` when omitted. |
webhookSecret? | string | Webhook signing secret. Auto-detected from `RESEND_WEBHOOK_SECRET` when omitted. |
Environment variables
| Variable | Required | Description |
|---|---|---|
RESEND_API_KEY | Yes, unless apiKey is passed | Resend API key. Overridden by config.apiKey. |
RESEND_WEBHOOK_SECRET | For webhooks | Webhook signing secret. Overridden by config.webhookSecret. |
FROM_ADDRESS | No | Used by example apps only. The adapter takes the sender from fromAddress. |
Email threading
Threads are resolved using the standard Message-ID, In-Reply-To, and References email headers. Reply chains are grouped into Chat SDK threads automatically, and your handlers receive each follow-up as an onSubscribedMessage event on the same thread.
Sending email proactively
Use openDM to start a new email thread to any address, for example to send notifications, alerts, or scheduled reports:
Rich card emails
Post a Chat SDK card and the adapter renders it to HTML email through @react-email/components:
Attachments
Inbound email attachments are exposed on message.raw.attachments as objects with filename, content_type, and url fields, not on message.attachments. Your handler can fetch the URL or pass it on to downstream processing.
The adapter doesn't send attachments. Files included in a posted message are not attached to the outgoing email.
Limitations
Email has no native concept of message edits, reactions, or typing indicators, so these operations throw NotImplementedError:
editMessage/deleteMessageaddReaction/removeReactionstartTyping
Send cards or new replies instead.
Feature support
Messaging
| Feature | Supported |
|---|---|
| Post message | |
| Message replies | |
| Edit message | |
| Delete message | |
| File uploads | |
| Streaming | |
| Scheduled messages |
Rich content
| Feature | Supported |
|---|---|
| Card format | HTML email via react-email |
| Buttons | |
| Link buttons | |
| Select menus | |
| Tables | |
| Charts | |
| Fields | |
| Images in cards | |
| Modals |
Conversations
| Feature | Supported |
|---|---|
| Slash commands | |
| Mentions | |
| Add reactions | |
| Remove reactions | |
| Typing indicator | |
| Mark as read | |
| Message edit events | |
| Message delete events | |
| DMs | |
| Ephemeral messages | |
| User lookup | |
| Parent subject | |
| Native client | |
| Custom API endpoint |
Message history
| Feature | Supported |
|---|---|
| Fetch messages | |
| Fetch single message | |
| Fetch thread info | |
| Fetch channel messages | |
| List threads | |
| Fetch channel info | |
| Post channel message |
Resources
Official docs are at resend.com/docs/chat-sdk. Example apps in the adapter repo:
| Example | Description |
|---|---|
| basic | Echo bot that replies to every email |
| welcome-cards | Sends a styled card email on first contact |
| notifications | Proactive emails via openDM() and an HTTP POST |
| support-bot | Multi-turn support with subscribe/unsubscribe |
| attachments | Detects attachments and replies with a summary |