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...");});
2M
Weekly downloads
2.3K
GitHub stars
98+
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 supportShip to every chat platform from one codebase, without per-platform rewrites.
  • Event-driven by designReact to mentions, reactions, and replies with handlers scoped to each thread.
  • Type-safe by defaultStrict types for adapters, handlers, and JSX cards, checked at build time.
bot.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(),});
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}`);});

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

Build with Chat SDK today

Visit Documentation
$npx create-chat-sdk@latest