{"id":51192947,"url":"https://github.com/resend/resend-chat-sdk","last_synced_at":"2026-06-27T17:30:29.337Z","repository":{"id":342962100,"uuid":"1168798408","full_name":"resend/resend-chat-sdk","owner":"resend","description":"Official Vercel Chat SDK adapter for Resend.","archived":false,"fork":false,"pushed_at":"2026-06-21T03:15:01.000Z","size":188,"stargazers_count":16,"open_issues_count":14,"forks_count":2,"subscribers_count":0,"default_branch":"canary","last_synced_at":"2026-06-21T05:09:13.935Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@resend/chat-sdk-adapter","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/resend.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-27T20:09:58.000Z","updated_at":"2026-05-27T17:30:11.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/resend/resend-chat-sdk","commit_stats":null,"previous_names":["resend/resend-chat-sdk"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/resend/resend-chat-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/resend%2Fresend-chat-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/resend%2Fresend-chat-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/resend%2Fresend-chat-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/resend%2Fresend-chat-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/resend","download_url":"https://codeload.github.com/resend/resend-chat-sdk/tar.gz/refs/heads/canary","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/resend%2Fresend-chat-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34862627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-27T02:00:06.362Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-27T17:30:29.037Z","updated_at":"2026-06-27T17:30:29.326Z","avatar_url":"https://github.com/resend.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @resend/chat-sdk-adapter\n\nVercel Chat SDK adapter for [Resend](https://resend.com) email. Bidirectional: receive emails via Resend webhooks, send emails via Resend API.\n\n## Install\n\n```bash\npnpm add @resend/chat-sdk-adapter chat @chat-adapter/shared\n```\n\n## Quick Start\n\n```ts\nimport { createResendAdapter } from \"@resend/chat-sdk-adapter\";\nimport { MemoryStateAdapter } from \"@chat-adapter/state-memory\";\nimport { Chat } from \"chat\";\n\nconst resend = createResendAdapter({\n  fromAddress: \"bot@yourdomain.com\",\n  fromName: \"My Bot\",         // optional\n  // apiKey: \"re_...\",        // or set RESEND_API_KEY env var\n  // webhookSecret: \"whsec_...\" // or set RESEND_WEBHOOK_SECRET env var\n});\n\nconst chat = new Chat({\n  userName: \"email-bot\",\n  adapters: { resend },\n  state: new MemoryStateAdapter(),\n});\n\n// New inbound email (new thread)\nchat.onNewMention(async (thread, message) =\u003e {\n  await thread.subscribe();\n  await thread.post(`Got your email: ${message.text}`);\n});\n\n// Follow-up email in a subscribed thread\nchat.onSubscribedMessage(async (thread, message) =\u003e {\n  await thread.post(`Reply: ${message.text}`);\n});\n```\n\nForward Resend webhooks to your server's `/webhook` endpoint. See [examples/basic](./examples/basic) for a full working server.\n\n## Configuration\n\n### Environment Variables\n\n| Variable | Description |\n|---|---|\n| `RESEND_API_KEY` | Resend API key (overridden by `config.apiKey`) |\n| `RESEND_WEBHOOK_SECRET` | Webhook signing secret (overridden by `config.webhookSecret`) |\n| `FROM_ADDRESS` | Used by example apps only |\n\n### `ResendAdapterConfig`\n\n```ts\ninterface ResendAdapterConfig {\n  /** Sender email address (required). */\n  fromAddress: string;\n  /** Display name for the From header. */\n  fromName?: string;\n  /** Resend API key. Falls back to RESEND_API_KEY env var. */\n  apiKey?: string;\n  /** Webhook signing secret. Falls back to RESEND_WEBHOOK_SECRET env var. */\n  webhookSecret?: string;\n}\n```\n\n## Features\n\n### Email Threading\n\nThreads are resolved using standard `Message-ID`, `In-Reply-To`, and `References` email headers. Reply chains are automatically grouped into Chat SDK threads.\n\n### Send Emails Proactively\n\nUse `openDM` to start a new email thread to any address:\n\n```ts\nconst threadId = await chat.adapters.resend.openDM(\"user@example.com\");\nconst thread = await chat.thread(\"resend\", threadId);\nawait thread.post(\"Hello from the bot!\");\n```\n\n### Card Emails\n\nSend rich HTML emails using Chat SDK Card elements, rendered via `@react-email/components`:\n\n```ts\nawait thread.post({\n  card: {\n    type: \"card\",\n    title: \"Order Confirmed\",\n    children: [\n      { type: \"text\", content: \"Your order #1234 has been shipped.\" },\n      { type: \"divider\" },\n      { type: \"link-button\", label: \"Track Order\", url: \"https://example.com/track/1234\" },\n    ],\n  },\n  fallbackText: \"Order #1234 confirmed\",\n});\n```\n\n### Attachments\n\nInbound email attachments are available in `message.raw.attachments` with `filename`, `content_type`, and `url` fields.\n\n## Unsupported Operations\n\nEmail is inherently one-shot. The following operations throw `NotImplementedError`:\n\n- `editMessage` / `deleteMessage`\n- `addReaction` / `removeReaction`\n- `startTyping`\n\n## Examples\n\n| Example | Description |\n|---|---|\n| [basic](./examples/basic) | Echo bot - replies to every email |\n| [welcome-cards](./examples/welcome-cards) | Sends a styled card email on first contact |\n| [notifications](./examples/notifications) | Proactive emails via `openDM()` + HTTP POST |\n| [support-bot](./examples/support-bot) | Multi-turn support with subscribe/unsubscribe |\n| [attachments](./examples/attachments) | Detects attachments and replies with a summary |\n\n## Documentation\n\nOfficial docs available at [resend.com/docs/chat-sdk](https://resend.com/docs/chat-sdk).\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fresend%2Fresend-chat-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fresend%2Fresend-chat-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fresend%2Fresend-chat-sdk/lists"}