惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

MyScale Blog
MyScale Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
人人都是产品经理
人人都是产品经理
V
Visual Studio Blog
博客园 - 叶小钗
A
About on SuperTechFans
Last Week in AI
Last Week in AI
量子位
博客园 - 三生石上(FineUI控件)
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
MongoDB | Blog
MongoDB | Blog
T
The Blog of Author Tim Ferriss
Vercel News
Vercel News
博客园 - 司徒正美
博客园 - Franky
博客园 - 【当耐特】
月光博客
月光博客
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Apple Machine Learning Research
Apple Machine Learning Research
Hugging Face - Blog
Hugging Face - Blog
S
SegmentFault 最新的问题
大猫的无限游戏
大猫的无限游戏
博客园 - 聂微东
J
Java Code Geeks

Chat SDK Documentation

History | Chat SDK History | Chat SDK List a vendor-official adapter | Chat SDK Approvals | Chat SDK Vercel Connect | Chat SDK Teams Low-Level APIs | Chat SDK CLI | Chat SDK Platform Adapters | Chat SDK State Adapters | Chat SDK Cards | Chat SDK Getting Started | Chat SDK Modals | Chat SDK Slack Low-Level APIs | Chat SDK Streaming | Chat SDK Testing | Chat SDK Overview | Chat SDK toAiMessages | Chat SDK Cards | Chat SDK Overview | Chat SDK Markdown | Chat SDK Modals | Chat SDK AI SDK Tools | Chat SDK Types | Chat SDK Message Subject | Chat SDK Conversation History | Chat SDK Transcripts | Chat SDK Slack bot with Next.js and Redis Actions | Chat SDK Direct Messages | Chat SDK Emoji | Chat SDK
Introduction | Chat SDK
Vercel · 2026-05-29 · via Chat SDK Documentation

A unified SDK for building chat bots across Slack, Microsoft Teams, Google Chat, Discord, Telegram, and more.

Chat SDK is a TypeScript library for building chat bots that work across multiple platforms with a single codebase. Write your bot logic once and deploy it to Slack, Microsoft Teams, Google Chat, Discord, Telegram, GitHub, Linear, WhatsApp, and Messenger.

Building a chat bot that works across multiple platforms typically means maintaining separate codebases, learning different APIs, and handling platform-specific quirks individually. Chat SDK abstracts these differences behind a unified interface.

  • Single codebase for all platforms
  • Type-safe adapters and event handlers with full TypeScript support
  • Event-driven architecture with handlers for mentions, messages, reactions, button clicks, slash commands, and modals
  • Thread subscriptions for multi-turn conversations
  • Rich UI with JSX cards, buttons, and modals that render natively on each platform
  • AI streaming with first-class support for streaming LLM responses
  • Serverless-ready with distributed state via Redis and message deduplication

Chat SDK has three core concepts:

  1. Chat — the main entry point that coordinates adapters and routes events to your handlers
  2. Adapters — platform-specific implementations that handle webhook parsing, message formatting, and API calls
  3. State — a pluggable persistence layer for thread subscriptions and distributed locking
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.");
});

Each adapter factory auto-detects credentials from environment variables (SLACK_BOT_TOKEN, SLACK_SIGNING_SECRET, REDIS_URL, etc.), so you can get started with zero config. Pass explicit values to override.

PlatformPackageMentionsReactionsCardsModalsStreamingDMs
Slack@chat-adapter/slackYesYesYesYesNativeYes
Microsoft Teams@chat-adapter/teamsYesRead-onlyYesYesNative (DMs) / BufferedYes
Google Chat@chat-adapter/gchatYesYesYesNoPost+EditYes
Discord@chat-adapter/discordYesYesYesNoPost+EditYes
Telegram@chat-adapter/telegramYesYesPartialNoPrivate chat drafts / Post+EditYes
GitHub@chat-adapter/githubYesYesNoNoBufferedNo
Linear@chat-adapter/linearYesYesNoNoAgent sessions / Post+EditNo
WhatsApp@chat-adapter/whatsappN/AYesPartialNoBufferedYes
Twilio@chat-adapter/twilioN/ANoFallbackNoBufferedYes
Messenger@chat-adapter/messengerYesReceive-onlyPartialNoBufferedYes

If you use an AI coding agent like Claude Code, you can teach it about Chat SDK by installing the skill:

npx skills add vercel/chat

This gives your agent access to Chat SDK's documentation, patterns, and best practices so it can help you build bots more effectively.

The SDK is distributed as a set of packages you install based on your needs:

PackageDescription
chatCore SDK with Chat class, types, JSX runtime, and utilities
chat/aiAI utilitiescreateChatTools for agent operations and toAiMessages for converting chat history into AI SDK prompts
@chat-adapter/slackSlack adapter
@chat-adapter/teamsMicrosoft Teams adapter
@chat-adapter/gchatGoogle Chat adapter
@chat-adapter/discordDiscord adapter
@chat-adapter/telegramTelegram adapter
@chat-adapter/githubGitHub Issues adapter
@chat-adapter/linearLinear Issues adapter
@chat-adapter/whatsappWhatsApp Business adapter
@chat-adapter/twilioTwilio SMS and MMS adapter
@chat-adapter/messengerFacebook Messenger adapter
@chat-adapter/state-redisRedis state adapter (production)
@chat-adapter/state-ioredisioredis state adapter (alternative)
@chat-adapter/state-pgPostgreSQL state adapter (production)
@chat-adapter/state-memoryIn-memory state adapter (development)