Usage
Creating a Chat InstanceThreads, Messages, and ChannelsHandling EventsPosting MessagesError HandlingTestingAI
OverviewAI SDK ToolstoAiMessagesTypesAdapters
OverviewPlatform AdaptersSlack Low-Level APIsTeams Low-Level APIsState AdaptersMessaging
StreamingDirect MessagesEphemeral MessagesFile UploadsConversation HistoryMessage SubjectOverlapping MessagesInteractivity
CardsModalsActionsSlash CommandsEmojiAPI Reference
OverviewChatThreadChannelMessagePostableMessageTranscriptsCardsMarkdownModalsContributing
Building a community adapterTesting adaptersDocumenting your adapterPublishing your adapterA unified TypeScript SDK for building chat bots with type-safe handlers, JSX cards, and multi-platform support—powered by Vercel
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...");});
The open-source chat toolkit designed to help developers build chat bots that run on Slack, Teams, Google Chat, Discord, WhatsApp, and more.
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(),});
bot.onNewMention(async (thread) => { await thread.subscribe(); await thread.post("Hello! I'm listening to this thread now.");});
bot.onSubscribedMessage(async (thread, message) => { await thread.post(`You said: ${message.text}`);});A unified API for building event-driven chat bots. Listen for mentions, subscribe to threads, and post rich cards across multiple platforms.
Supports
Plug Chat SDK into an entire ecosystem designed for AI-native chat experiences that scale.
Vercel Sandbox
Build knowledge agents with persistent filesystems to search, index, and read files.
Workflows NEW
Build durable chat agents that suspend, resume, and survive function timeouts.
Get started by exploring the docs, following a guide, or using a template.
Stream agent responses and tool calls into Slack threads.
bot.onNewMention(async (thread, msg) => { await thread.subscribe(); const result = await agent.stream({ prompt: msg.text, }); await thread.post(result.fullStream);});Answer questions from synced docs and repos with file-system search.
const savoir = createSavoir({ apiUrl: process.env.SAVOIR_URL, apiKey: process.env.SAVOIR_API_KEY,});
const { text } = await generateText({ model, tools: savoir.tools, maxSteps: 10, prompt: "How do I configure auth?",});Review pull requests with sandboxed AI analysis on GitHub.
bot.onNewMention(async (thread, msg) => { const { data: pr } = await octokit.pulls.get({ owner, repo, pull_number, }); await thread.post("Starting code review..."); const review = await reviewPullRequest({ owner, repo, prBranch: pr.head.ref, }); await thread.post(review);});