Universal chat layer for building bots and agents

A unified TypeScript SDK for building chat bots with type-safe handlers, JSX cards, and multi-platform support—powered by Vercel

$npm install chat
general
TypeScriptbot.ts
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...");});
447.3K
Weekly downloads
1.8K
GitHub stars
51+
Contributors
15+
Adapters

The Platform-Agnostic Chat Toolkit

The open-source chat toolkit designed to help developers build chat bots that run on Slack, Teams, Google Chat, Discord, WhatsApp, and more.

Multi-platform support.

Ship to every chat platform from one codebase.

Event-driven by design.

React to mentions, reactions, and replies.

Type-safe by default.

Strict types for adapters, handlers, and JSX cards.

Reactbot.ts
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 }`);});

Chat SDK Core

A unified API for building event-driven chat bots. Listen for mentions, subscribe to threads, and post rich cards across multiple platforms.

Visit Documentation

Supports

Scale with confidence

Plug Chat SDK into an entire ecosystem designed for AI-native chat experiences that scale.

AI SDK

Build AI agents with streaming, tool calls, and structured outputs.

$ npm i ai

Vercel AI Gateway

Access 100+ models with one API key and no markup.

$ npm i ai

Vercel Sandbox

Build knowledge agents with persistent filesystems to search, index, and read files.

$ npm i @vercel/sandbox

Workflows NEW

Build durable chat agents that suspend, resume, and survive function timeouts.

$ npm i workflow

Build with Chat SDK today

Get started by exploring the docs, following a guide, or using a template.

Visit Documentation
npm i chat