This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @chat-adapter/discord@4.38.0 ### Minor Changes -a0cba02: Add Vercel Connect credential resolvers and custom webhook verification to the Discord adapter, with `create-chat-sdk --connect` scaffolding for Discord bots. ### Patch Changes -a94995e: Restore attachment downloads across Discord inbound message paths. -4bdf721: Preserve content and attachments from forwarded Discord message snapshots. - Updated dependencies [0f24cc3] - Updated dependencies [bdeb2bf] - Updated dependencies [a0cba02] - Updated dependencies [83ede7e] - Updated dependencies [18d4a23] - chat@4.38.0 - @chat-adapter/shared@4.38.0 ## @chat-adapter/messenger@4.38.0 ### Minor Changes -18d4a23: Add a shared thread API for marking messages as read across WhatsApp, Messenger, and XChat. Note for anyone calling `XchatAdapter.markAsRead()` directly: it now rejects when a receipt fails instead of logging a warning and resolving. Automatic read receipts are unaffected, since the adapter still catches and logs those internally. If you call the method yourself without awaiting it, add a `.catch()` so a failed receipt does not surface as an unhandled rejection. ### Patch Changes - Updated dependencies [0f24cc3] - Updated dependencies [bdeb2bf] - Updated dependencies [a0cba02] - Updated dependencies [83ede7e] - Updated dependencies [18d4a23] - chat@4.38.0 - @chat-adapter/shared@4.38.0 ## @chat-adapter/notion@4.38.0 ### Minor Changes -06b04ac: Add outbound-only Vercel Connect authentication for Notion while retaining native webhook verification and scaffolding. ### Patch Changes - Updated dependencies [0f24cc3] - Updated dependencies [bdeb2bf] - Updated dependencies [a0cba02] - Updated dependencies [83ede7e] - Updated dependencies [18d4a23] - chat@4.38.0 - @chat-adapter/shared@4.38.0 ## @chat-adapter/telegram@4.38.0 ### Minor Changes -0f24cc3: Preserve normalized replied-to message context and populate it from Telegram replies. -7a1150c: Add outbound-only Vercel Connect authentication for Telegram while retaining native webhook verification or polling. -3bbf3ff: Use post-and-edit streaming by default and make native Telegram drafts opt-in. Streams now render the same way in every chat type; set the new `nativeStreaming: true` config option to restore draft previews in private chats. The adapter now owns the post-and-edit loop so edits stay under Telegram's per-chat rate limit. Edits are throttled to a 1100ms floor, configurable with the new `streamingEditIntervalMs` option, and a rate-limited final edit is retried once instead of failing the post. ### Patch Changes -1d2b78d: Deduplicate repeated Telegram webhook updates by their update ID using the configured state adapter. -745fdf5: respect Telegram streaming rate limits and target XChat read receipts exactly - Updated dependencies [0f24cc3] - Updated dependencies [bdeb2bf] - Updated dependencies [a0cba02] - Updated dependencies [83ede7e] - Updated dependencies [18d4a23] - chat@4.38.0 - @chat-adapter/shared@4.38.0 ## @chat-adapter/whatsapp@4.38.0 ### Minor Changes -83ede7e: add native message replies with WhatsApp contextual reply support -18d4a23: Add a shared thread API for marking messages as read across WhatsApp, Messenger, and XChat. Note for anyone calling `XchatAdapter.markAsRead()` directly: it now rejects when a receipt fails instead of logging a warning and resolving. Automatic read receipts are unaffected, since the adapter still catches and logs those internally. If you call the method yourself without awaiting it, add a `.catch()` so a failed receipt does not surface as an unhandled rejection. ### Patch Changes - Updated dependencies [0f24cc3] - Updated dependencies [bdeb2bf] - Updated dependencies [a0cba02] - Updated dependencies [83ede7e] - Updated dependencies [18d4a23] - chat@4.38.0 - @chat-adapter/shared@4.38.0 ## @chat-adapter/x@4.38.0 ### Minor Changes -18d4a23: Add a shared thread API for marking messages as read across WhatsApp, Messenger, and XChat. Note for anyone calling `XchatAdapter.markAsRead()` directly: it now rejects when a receipt fails instead of logging a warning and resolving. Automatic read receipts are unaffected, since the adapter still catches and logs those internally. If you call the method yourself without awaiting it, add a `.catch()` so a failed receipt does not surface as an unhandled rejection. ### Patch Changes -745fdf5: respect Telegram streaming rate limits and target XChat read receipts exactly - Updated dependencies [0f24cc3] - Updated dependencies [bdeb2bf] - Updated dependencies [a0cba02] - Updated dependencies [83ede7e] - Updated dependencies [18d4a23] - chat@4.38.0 - @chat-adapter/shared@4.38.0 ## chat@4.38.0 ### Minor Changes -0f24cc3: Preserve normalized replied-to message context and populate it from Telegram replies. -bdeb2bf: Add a workflow-safe `chat/serialization` entrypoint and isolate automatic Chat class serializers from Node-only runtime dependencies. -a0cba02: Add Vercel Connect credential resolvers and custom webhook verification to the Discord adapter, with `create-chat-sdk --connect` scaffolding for Discord bots. -83ede7e: add native message replies with WhatsApp contextual reply support -18d4a23: Add a shared thread API for marking messages as read across WhatsApp, Messenger, and XChat. Note for anyone calling `XchatAdapter.markAsRead()` directly: it now rejects when a receipt fails instead of logging a warning and resolving. Automatic read receipts are unaffected, since the adapter still catches and logs those internally. If you call the method yourself without awaiting it, add a `.catch()` so a failed receipt does not surface as an unhandled rejection. ## create-chat-sdk@0.4.0 ### Minor Changes -a0cba02: Add Vercel Connect credential resolvers and custom webhook verification to the Discord adapter, with `create-chat-sdk --connect` scaffolding for Discord bots. -06b04ac: Add outbound-only Vercel Connect authentication for Notion while retaining native webhook verification and scaffolding. -7a1150c: Add outbound-only Vercel Connect authentication for Telegram while retaining native webhook verification or polling. ## @chat-adapter/gchat@4.38.0 ### Patch Changes -2f40a32: Fix attachment downloads failing with a 400 when `attachmentDataRef` is present `fetchAttachmentData` called the Chat media endpoint without `alt=media`, so it returned resource metadata rather than file bytes and rejected the arraybuffer request with a bare 400. Every download by `resourceName` failed, which is the path taken for any file uploaded directly to Chat. The download path is also hardened: when `media.download` fails and the attachment carries a `downloadUri`, the adapter now falls back to fetching that URL instead of rejecting, and failures with no fallback are routed through the shared error handling so a 429 surfaces as `AdapterRateLimitError` like every other Chat API call. - Updated dependencies [0f24cc3] - Updated dependencies [bdeb2bf] - Updated dependencies [a0cba02] - Updated dependencies [83ede7e] - Updated dependencies [18d4a23] - chat@4.38.0 - @chat-adapter/shared@4.38.0 ## @chat-adapter/github@4.38.0 ### Patch Changes - Updated dependencies [0f24cc3] - Updated dependencies [bdeb2bf] - Updated dependencies [a0cba02] - Updated dependencies [83ede7e] - Updated dependencies [18d4a23] - chat@4.38.0 - @chat-adapter/shared@4.38.0 ## @chat-adapter/instagram@4.38.0 ### Patch Changes - Updated dependencies [0f24cc3] - Updated dependencies [bdeb2bf] - Updated dependencies [a0cba02] - Updated dependencies [83ede7e] - Updated dependencies [18d4a23] - chat@4.38.0 - @chat-adapter/shared@4.38.0 ## @chat-adapter/linear@4.38.0 ### Patch Changes - Updated dependencies [0f24cc3] - Updated dependencies [bdeb2bf] - Updated dependencies [a0cba02] - Updated dependencies [83ede7e] - Updated dependencies [18d4a23] - chat@4.38.0 - @chat-adapter/shared@4.38.0 ## @chat-adapter/shared@4.38.0 ### Patch Changes - Updated dependencies [0f24cc3] - Updated dependencies [bdeb2bf] - Updated dependencies [a0cba02] - Updated dependencies [83ede7e] - Updated dependencies [18d4a23] - chat@4.38.0 ## @chat-adapter/slack@4.38.0 ### Patch Changes - Updated dependencies [0f24cc3] - Updated dependencies [bdeb2bf] - Updated dependencies [a0cba02] - Updated dependencies [83ede7e] - Updated dependencies [18d4a23] - chat@4.38.0 - @chat-adapter/shared@4.38.0 ## @chat-adapter/teams@4.38.0 ### Patch Changes - Updated dependencies [0f24cc3] - Updated dependencies [bdeb2bf] - Updated dependencies [a0cba02] - Updated dependencies [83ede7e] - Updated dependencies [18d4a23] - chat@4.38.0 - @chat-adapter/shared@4.38.0 ## @chat-adapter/twilio@4.38.0 ### Patch Changes - Updated dependencies [0f24cc3] - Updated dependencies [bdeb2bf] - Updated dependencies [a0cba02] - Updated dependencies [83ede7e] - Updated dependencies [18d4a23] - chat@4.38.0 - @chat-adapter/shared@4.38.0 ## @chat-adapter/web@4.38.0 ### Patch Changes - Updated dependencies [0f24cc3] - Updated dependencies [bdeb2bf] - Updated dependencies [a0cba02] - Updated dependencies [83ede7e] - Updated dependencies [18d4a23] - chat@4.38.0 - @chat-adapter/shared@4.38.0 ## @chat-adapter/state-ioredis@4.38.0 ### Patch Changes - Updated dependencies [0f24cc3] - Updated dependencies [bdeb2bf] - Updated dependencies [a0cba02] - Updated dependencies [83ede7e] - Updated dependencies [18d4a23] - chat@4.38.0 ## @chat-adapter/state-memory@4.38.0 ### Patch Changes - Updated dependencies [0f24cc3] - Updated dependencies [bdeb2bf] - Updated dependencies [a0cba02] - Updated dependencies [83ede7e] - Updated dependencies [18d4a23] - chat@4.38.0 ## @chat-adapter/state-pg@4.38.0 ### Patch Changes - Updated dependencies [0f24cc3] - Updated dependencies [bdeb2bf] - Updated dependencies [a0cba02] - Updated dependencies [83ede7e] - Updated dependencies [18d4a23] - chat@4.38.0 ## @chat-adapter/state-redis@4.38.0 ### Patch Changes - Updated dependencies [0f24cc3] - Updated dependencies [bdeb2bf] - Updated dependencies [a0cba02] - Updated dependencies [83ede7e] - Updated dependencies [18d4a23] - chat@4.38.0 ## @chat-adapter/tests@4.38.0 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
.nvmrc file, formally specify Node version range support, and cover more versions in CI (#465)
Chat SDK
Unified TypeScript SDK for building chat bots across Slack, Microsoft Teams, Google Chat, Discord, Telegram, GitHub, Linear, WhatsApp, and more. Write your bot logic once, deploy everywhere.
Installation
npm i chat
Install one or more adapters for your platforms:
npm install @chat-adapter/slack @chat-adapter/teams @chat-adapter/gchat
CLI
Scaffold a minimal Next.js bot app with create-chat-sdk:
npx create-chat-sdk@latest my-bot
The CLI generates your Chat configuration, webhook route, .env.example file, dependencies, and optional Web adapter route from the adapter catalog. See the CLI docs for options and non-interactive usage.
Usage
import { Chat } from "chat";
import { createSlackAdapter } from "@chat-adapter/slack";
import { createRedisState } from "@chat-adapter/state-redis";
const bot = new Chat({
userName: "mybot",
adapters: {
slack: createSlackAdapter(),
},
state: createRedisState(),
});
bot.onNewMention(async (thread) => {
await thread.subscribe();
await thread.post("Hello! I'm listening to this thread.");
});
bot.onSubscribedMessage(async (thread, message) => {
await thread.post(`You said: ${message.text}`);
});
See the Getting Started guide for a full walkthrough.
Adapters
Browse official, vendor-official, and community adapters on chat-sdk.dev/adapters. Learn how to build your own adapter.
Features
- Event handlers — mentions, messages, reactions, button clicks, slash commands, modals
- AI streaming — stream LLM responses with native Slack streaming, Telegram private chat draft previews, and post+edit fallback
- Cards — JSX-based interactive cards (Block Kit, Adaptive Cards, Google Chat Cards)
- Actions — handle button clicks and dropdown selections
- Modals — form dialogs with text inputs, dropdowns, and validation
- Slash commands — handle
/commandinvocations - Emoji — type-safe, cross-platform emoji with custom emoji support
- File uploads — send and receive file attachments
- Direct messages — initiate DMs programmatically
- Ephemeral messages — user-only visible messages with DM fallback
- Overlapping messages - burst, queue, debounce, drop, or process concurrent messages on the same thread
AI Coding Agents
If you use an AI coding agent such as OpenAI Codex, Claude Code, or Cursor, install the Chat SDK skill so it knows the SDK APIs, adapter patterns, and project conventions before writing code.
npx skills add vercel/chat
The skill references bundled documentation in node_modules/chat/docs, plus adapter guides and starter templates in the published package.
You can also install the Vercel Plugin for a broader agent toolkit. It includes the Chat SDK skill alongside specialist agents, slash commands, and more:
npx plugins add vercel/vercel-plugin
For agent-readable documentation, see chat-sdk.dev/llms.txt (page index) or chat-sdk.dev/llms-full.txt (full text).
Documentation
Full documentation is available at chat-sdk.dev/docs and guides are available in the Vercel Knowledge Base.
Contributing
See CONTRIBUTING.md for guidance on contributing to Chat SDK.
Support
For help or questions, see SUPPORT.md.
To report a security vulnerability, see SECURITY.md.
License
MIT