Features
ActionsCardsDirect messagesEmojiEphemeral messagesFile uploadsModalsSlash CommandsStreamingError handlingPlatform Adapters
OverviewSlackMicrosoft TeamsGoogle ChatDiscordGitHubLinearState Adapters
OverviewRedisioredisMemoryGuides
Slack bot with Next.js and RedisCode review GitHub bot with Hono and RedisDiscord support bot with Nuxt and RedisAPI Reference
OverviewChatThreadChannelMessagePostableMessageCardsMarkdownModalsChat SDK is now open source and in beta
A unified TypeScript SDK for building chat bots across Slack, Microsoft Teams, Google Chat, Discord, and more. Write your bot logic once, deploy everywhere.
See how your handlers respond to real-time chat events across any platform.
bot.onNewMention(async (thread) => { await thread.subscribe(); await thread.post("Sure! Here's a quick summary...");});bot.onReaction(async (thread, reaction) => { await thread.post(`Thanks for the ${reaction.emoji}!`);});bot.onSubscribedMessage(async (thread, msg) => { await thread.post("Checking now...");});
Deploy to Slack, Teams, Google Chat, Discord, GitHub, and Linear from a single codebase.
Full TypeScript support with type-safe adapters, event handlers, and JSX cards.
First-class support for streaming LLM responses with native platform rendering.
Install the SDK and pair it with your favorite chat providers and state management solutions.
import { Chat } from "chat";import { createSlackAdapter } from "@chat-adapter/slack";import { createRedisState } from "@chat-adapter/state-redis";
export const bot = new Chat({ userName: "mybot", adapters: { slack: createSlackAdapter(), }, state: createRedisState(),});
// Respond when someone @mentions the botbot.onNewMention(async (thread) => { await thread.subscribe(); await thread.post("Hello! I'm listening to this thread now.");});
// Respond to follow-up messages in subscribed threadsbot.onSubscribedMessage(async (thread, message) => { await thread.post(`You said: ${ message.text }`);});Step-by-step guides to help you build common patterns with the Chat SDK.
Build a Slack bot from scratch using Chat SDK, Next.js, and Redis.
const bot = new Chat({ userName: "my-bot", adapters: { slack: createSlackAdapter(), }, state: createRedisState(),});Build a Discord support bot using Chat SDK, Nuxt, and AI SDK.
bot.onNewMention(async (thread) => { await thread.subscribe(); await thread.post( <Card title="Support"> <Text>Ask your question and I'll do my best to answer.</Text> <Actions> <Button id="escalate"> Escalate to Human </Button> </Actions> </Card> );});Build a GitHub bot that reviews pull requests using AI SDK and Vercel Sandbox.
const sandbox = await Sandbox.create({ source: { type: "git", url: `https://github.com/${owner}/${repo}`, username: "x-access-token", password: process.env.GITHUB_TOKEN, },});
const { tools } = await createBashTool({ sandbox,});