
Security News
Feross on TBPN: Socket's Series C and the State of Software Supply Chain Security
Feross Aboukhadijeh joins TBPN to discuss Socket's $60M Series C, 500%+ ARR growth, AI's impact on open source, and the rise in supply chain attacks.
@resend/chat-sdk-adapter
Advanced tools
Vercel Chat SDK adapter for Resend email. Bidirectional: receive emails via Resend webhooks, send emails via Resend API.
pnpm add @resend/chat-sdk-adapter chat @chat-adapter/shared
import { createResendAdapter } from "@resend/chat-sdk-adapter";
import { MemoryStateAdapter } from "@chat-adapter/state-memory";
import { Chat } from "chat";
const resend = createResendAdapter({
fromAddress: "bot@yourdomain.com",
fromName: "My Bot", // optional
// apiKey: "re_...", // or set RESEND_API_KEY env var
// webhookSecret: "whsec_..." // or set RESEND_WEBHOOK_SECRET env var
});
const chat = new Chat({
userName: "email-bot",
adapters: { resend },
state: new MemoryStateAdapter(),
});
// New inbound email (new thread)
chat.onNewMention(async (thread, message) => {
await thread.subscribe();
await thread.post(`Got your email: ${message.text}`);
});
// Follow-up email in a subscribed thread
chat.onSubscribedMessage(async (thread, message) => {
await thread.post(`Reply: ${message.text}`);
});
Forward Resend webhooks to your server's /webhook endpoint. See examples/basic for a full working server.
| Variable | Description |
|---|---|
RESEND_API_KEY | Resend API key (overridden by config.apiKey) |
RESEND_WEBHOOK_SECRET | Webhook signing secret (overridden by config.webhookSecret) |
FROM_ADDRESS | Used by example apps only |
ResendAdapterConfiginterface ResendAdapterConfig {
/** Sender email address (required). */
fromAddress: string;
/** Display name for the From header. */
fromName?: string;
/** Resend API key. Falls back to RESEND_API_KEY env var. */
apiKey?: string;
/** Webhook signing secret. Falls back to RESEND_WEBHOOK_SECRET env var. */
webhookSecret?: string;
}
Threads are resolved using standard Message-ID, In-Reply-To, and References email headers. Reply chains are automatically grouped into Chat SDK threads.
Use openDM to start a new email thread to any address:
const threadId = await chat.adapters.resend.openDM("user@example.com");
const thread = await chat.thread("resend", threadId);
await thread.post("Hello from the bot!");
Send rich HTML emails using Chat SDK Card elements, rendered via @react-email/components:
await thread.post({
card: {
type: "card",
title: "Order Confirmed",
children: [
{ type: "text", content: "Your order #1234 has been shipped." },
{ type: "divider" },
{ type: "link-button", label: "Track Order", url: "https://example.com/track/1234" },
],
},
fallbackText: "Order #1234 confirmed",
});
Inbound email attachments are available in message.raw.attachments with filename, content_type, and url fields.
Email is inherently one-shot. The following operations throw NotImplementedError:
editMessage / deleteMessageaddReaction / removeReactionstartTyping| Example | Description |
|---|---|
| basic | Echo bot - replies to every email |
| welcome-cards | Sends a styled card email on first contact |
| notifications | Proactive emails via openDM() + HTTP POST |
| support-bot | Multi-turn support with subscribe/unsubscribe |
| attachments | Detects attachments and replies with a summary |
Official docs available at resend.com/docs/chat-sdk.
MIT
FAQs
Vercel Chat SDK adapter for Resend email
The npm package @resend/chat-sdk-adapter receives a total of 5,359 weekly downloads. As such, @resend/chat-sdk-adapter popularity was classified as popular.
We found that @resend/chat-sdk-adapter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Feross Aboukhadijeh joins TBPN to discuss Socket's $60M Series C, 500%+ ARR growth, AI's impact on open source, and the rise in supply chain attacks.

Security News
OSV withdrew 157 OSV malware reports after automated false positives incorrectly flagged trusted npm and PyPI packages, sending bad records into tools that rely on OSV data.

Research
/Security News
TrapDoor crypto stealer hits 36 malicious packages across npm, PyPI, and Crates.io, targeting crypto, DeFi, AI, and security developers.