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
Platform
bot.tsx
import { Actions, Button, Card, CardText } from "chat";

bot.onNewMention(async (thread) => {
  await thread.post(
    <Card title="Deploy to production?">
      <CardText>PR #103 passed every check.</CardText>
      <Actions>
        <Button id="approve" style="primary">Approve</Button>
        <Button id="cancel">Cancel</Button>
      </Actions>
    </Card>
  );
});

// deploy() returns an AsyncIterable<string>, so the reply streams
bot.onAction("approve", async (event) => {
  await event.thread?.post(deploy(103));
});

bot.onAction("cancel", async (event) => {
  await event.thread?.post("Deploy canceled.");
});
A
Alice9:41 AM
@DeployBot can we ship PR #103?
D
DeployBotApp9:41 AM

Deploy to production?

PR #103 passed every check.

Same code on every platform. See all adapters

Weekly downloads
5.1M
GitHub stars
2.4K
Contributors
132+
Adapters
15+

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, without per-platform rewrites.

  • Event-driven by design

    React to mentions, reactions, and replies with handlers scoped to each thread.

  • Type-safe by default

    Strict types for adapters, handlers, and JSX cards, checked at build time.

Explore Chat SDK

Read the docs

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

Scale with confidence

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

Build with Chat SDK today

Start from a template, or follow a guide to use Chat SDK with Vercel Connect and eve.

Read the docs
$npx create-chat-sdk@latest