﻿---
title: Introduction
description: A unified SDK for building chat bots across Slack, Microsoft Teams, Google Chat, Discord, Telegram, and more.
type: overview
---

# Introduction



Chat SDK is a TypeScript library for building chat bots that work across multiple platforms with a single codebase. Write your bot logic once and deploy it to Slack, Microsoft Teams, Google Chat, Discord, Telegram, GitHub, Linear, WhatsApp, and Messenger.

## Why Chat SDK?

Building a chat bot that works across multiple platforms typically means maintaining separate codebases, learning different APIs, and handling platform-specific quirks individually. Chat SDK abstracts these differences behind a unified interface.

* **Single codebase** for all platforms
* **Type-safe** [adapters](/adapters) and event handlers with full TypeScript support
* **Event-driven** architecture with handlers for mentions, messages, reactions, button clicks, slash commands, and modals
* **Thread subscriptions** for multi-turn conversations
* **Rich UI** with JSX cards, buttons, and modals that render natively on each platform
* **AI streaming** with first-class support for streaming LLM responses
* **Serverless-ready** with distributed state via Redis and message deduplication

## How it works

Chat SDK has three core concepts:

1. **Chat** — the main entry point that coordinates [adapters](/adapters) and routes events to your handlers
2. **[Adapters](/adapters)** — platform-specific implementations that handle webhook parsing, message formatting, and API calls
3. **State** — a pluggable persistence layer for thread subscriptions and distributed locking

```typescript title="lib/bot.ts" lineNumbers
import { Chat } from "chat";
import { createSlackAdapter } from "@chat-adapter/slack";
import { createRedisState } from "@chat-adapter/state-redis";

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

Each adapter factory auto-detects credentials from environment variables (`SLACK_BOT_TOKEN`, `SLACK_SIGNING_SECRET`, `REDIS_URL`, etc.), so you can get started with zero config. Pass explicit values to override.

## Supported platforms

| Platform        | Package                   | Mentions | Reactions    | Cards    | Modals | Streaming                       | DMs |
| --------------- | ------------------------- | -------- | ------------ | -------- | ------ | ------------------------------- | --- |
| Slack           | `@chat-adapter/slack`     | Yes      | Yes          | Yes      | Yes    | Native                          | Yes |
| Microsoft Teams | `@chat-adapter/teams`     | Yes      | Read-only    | Yes      | Yes    | Native (DMs) / Buffered         | Yes |
| Google Chat     | `@chat-adapter/gchat`     | Yes      | Yes          | Yes      | No     | Post+Edit                       | Yes |
| Discord         | `@chat-adapter/discord`   | Yes      | Yes          | Yes      | No     | Post+Edit                       | Yes |
| Telegram        | `@chat-adapter/telegram`  | Yes      | Yes          | Partial  | No     | Private chat drafts / Post+Edit | Yes |
| GitHub          | `@chat-adapter/github`    | Yes      | Yes          | No       | No     | Buffered                        | No  |
| Linear          | `@chat-adapter/linear`    | Yes      | Yes          | No       | No     | Agent sessions / Post+Edit      | No  |
| WhatsApp        | `@chat-adapter/whatsapp`  | N/A      | Yes          | Partial  | No     | Buffered                        | Yes |
| Twilio          | `@chat-adapter/twilio`    | N/A      | No           | Fallback | No     | Buffered                        | Yes |
| Messenger       | `@chat-adapter/messenger` | Yes      | Receive-only | Partial  | No     | Buffered                        | Yes |

## AI coding agent support

If you use an AI coding agent like [Claude Code](https://docs.anthropic.com/en/docs/claude-code), you can teach it about Chat SDK by installing the skill:

```bash
npx skills add vercel/chat
```

This gives your agent access to Chat SDK's documentation, patterns, and best practices so it can help you build bots more effectively.

## Packages

The SDK is distributed as a set of packages you install based on your needs:

| Package                       | Description                                                                                                                                                                              |
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `chat`                        | Core SDK with `Chat` class, types, JSX runtime, and utilities                                                                                                                            |
| `chat/ai`                     | [AI utilities](/docs/ai) — [`createChatTools`](/docs/ai/ai-sdk-tools) for agent operations and [`toAiMessages`](/docs/ai/to-ai-messages) for converting chat history into AI SDK prompts |
| `@chat-adapter/slack`         | Slack adapter                                                                                                                                                                            |
| `@chat-adapter/teams`         | Microsoft Teams adapter                                                                                                                                                                  |
| `@chat-adapter/gchat`         | Google Chat adapter                                                                                                                                                                      |
| `@chat-adapter/discord`       | Discord adapter                                                                                                                                                                          |
| `@chat-adapter/telegram`      | Telegram adapter                                                                                                                                                                         |
| `@chat-adapter/github`        | GitHub Issues adapter                                                                                                                                                                    |
| `@chat-adapter/linear`        | Linear Issues adapter                                                                                                                                                                    |
| `@chat-adapter/whatsapp`      | WhatsApp Business adapter                                                                                                                                                                |
| `@chat-adapter/twilio`        | Twilio SMS and MMS adapter                                                                                                                                                               |
| `@chat-adapter/messenger`     | Facebook Messenger adapter                                                                                                                                                               |
| `@chat-adapter/state-redis`   | Redis state adapter (production)                                                                                                                                                         |
| `@chat-adapter/state-ioredis` | ioredis state adapter (alternative)                                                                                                                                                      |
| `@chat-adapter/state-pg`      | PostgreSQL state adapter (production)                                                                                                                                                    |
| `@chat-adapter/state-memory`  | In-memory state adapter (development)                                                                                                                                                    |
