A 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.
Authenticate a Slack bot with Vercel Connect instead of stored secrets.
import { createSlackAdapter } from "@chat-adapter/slack";import { connectSlackAdapter } from "@vercel/connect/chat";
const slack = createSlackAdapter({ ...connectSlackAdapter("slack/acme-slack"),});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);});