Eve
Eve is an open-source framework for building agents created by Vercel. It's filesystem-first, inspired by Next.js, and provides tools, workflows, connections, hooks, and channels for you to build long-running, durable agents.
Using the Resend adapter for the Vercel Chat SDK you can plug in email as a channel to your eve agent.
Prerequisites
Section titled “Prerequisites”To get started, you'll need to:
- Create an API key
- Verify your domain
- Set up webhooks for
email.receivedevents - Enable receiving on your domain
Install
Create a new project with eve and then install the Chat SDK, the Resend adapter, and the development state adapter.
npm npx eve@latest init my-agent cd my-agent npm install @resend/chat-sdk-adapter chat @chat-adapter/state-memoryyarn yarn dlx eve@latest init my-agent cd my-agent yarn add @resend/chat-sdk-adapter chat @chat-adapter/state-memorypnpm pnpm dlx eve@latest init my-agent cd my-agent pnpm add @resend/chat-sdk-adapter chat @chat-adapter/state-memorybun bunx eve@latest init my-agent cd my-agent bun add @resend/chat-sdk-adapter chat @chat-adapter/state-memoryConfigure the adapter
Create the Resend adapter with the adapter configuration options. Then create a Chat SDK channel with the adapter, a username for the bot, and an adapter state.
streamingshould be set to false as emails can only deliver one message per turn.Export the
channelobject and the framework will integrate it automatically.TypeScript import { createResendAdapter } from '@resend/chat-sdk-adapter'; import { chatSdkChannel } from 'eve/channels/chat-sdk'; import { createMemoryState } from '@chat-adapter/state-memory'; export const resendAdapter = createResendAdapter({ fromAddress: 'bot@example.com', fromName: 'My Bot', }); export const { bot, channel, send } = chatSdkChannel({ adapters: { resend: resendAdapter }, userName: 'My Bot', state: createMemoryState(), streaming: false, }); export default channel;Handle new messages
Register handlers for incoming messages.
onNewMentionevent fires when a new thread starts andonSubscribedMessagefires for follow-up emails in threads you are already subscribed to.TypeScript bot.onNewMention(async (thread, message) => { await thread.subscribe(); await send(message.text, { thread }); }); bot.onSubscribedMessage(async (thread, message) => { await send(message.text, { thread }); });Threading is handled by the Chat SDK adapter.
Configure webhooks
Eve registers adapter endpoints at
/eve/v1/resend. Edit your webhook foremail.receivedevents to point to this endpoint.
Configuration options
Section titled “Configuration options”| Parameter | Type | Required | Description |
|---|---|---|---|
fromAddress |
string |
Yes | Sender email address |
fromName |
string |
No | Display name for the From header |
apiKey |
string |
No | Resend API key. Falls back to RESEND_API_KEY env var |
webhookSecret |
string |
No | Webhook signing secret. Falls back to RESEND_WEBHOOK_SECRET env var |