| name | chat-sdk |
| description | Expert at Chat SDK (vercel/chat) - the unified TypeScript SDK for building chat bots and agents across Slack, Microsoft Teams, Google Chat, Discord, Telegram, WhatsApp, and more. Use when building multi-platform bots, chat adapters, JSX cards, modals, slash commands, or AI streaming to chat platforms. Triggers on mentions of Chat SDK, chat bots, Slack bot, Teams bot, Discord bot, chat adapters. |
| allowed-tools | Read, Write, Edit, Glob, Grep, Bash, WebFetch |
Chat SDK Skill
Expert at building multi-platform chat bots and agents with Chat SDK (vercel/chat).
Overview
Chat SDK is a TypeScript library for building chat bots that run across multiple platforms from a single codebase:
- Single codebase deployed to Slack, Teams, Google Chat, Discord, Telegram, GitHub, Linear, WhatsApp, Messenger, and more
- Type-safe platform adapters with auto-detected credentials
- Event-driven handlers for mentions, messages, reactions, button clicks, slash commands, and modals
- Thread subscriptions for multi-turn conversations
- Rich UI via JSX cards, buttons, and modals rendered natively per platform
- First-class AI streaming support and serverless-ready distributed state (Redis, ioredis, Postgres, MySQL, Durable Objects)
Quick Start
import { Chat } from "chat";
import { createSlackAdapter } from "@chat-adapter/slack";
import { createRedisState } from "@chat-adapter/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.");
});
Core Concepts
- Chat — the main entry point that coordinates adapters and routes events to handlers
- Adapters — platform-specific implementations handling webhook parsing, message formatting, and API calls (official, vendor-official, and community adapters)
- State — a pluggable persistence layer for thread subscriptions, distributed locking, and dedup (memory, Redis, ioredis, Postgres, MySQL, Durable Objects)
Documentation
Getting started & usage: Introduction, Getting Started, CLI, Creating a Chat Instance, Threads/Messages/Channels, Handling Events, Posting Messages, Error Handling, Testing
AI: Overview, AI SDK Tools, toAiMessages, Types
Adapters: Overview, Platform Adapters, Slack Low-Level APIs, Teams Low-Level APIs, State Adapters
Messaging & interactivity: Streaming, Direct Messages, Ephemeral Messages, File Uploads, Conversation History, Cards, Modals, Actions, Slash Commands, Emoji, Overlapping Messages
API reference: Overview, Chat, Thread, Channel, Message, Cards, Modals, Markdown, Transcripts
Contributing: Building an adapter, Testing adapters, Publishing
Adapters catalog: official adapters cached as docs/adapter-<name>.md (slack, teams, gchat, discord, telegram, github, linear, whatsapp, twilio, messenger, web, memory, redis, ioredis, postgres), vendor-official adapters as docs/adapter-vendor-<name>.md (liveblocks, resend, novu, sendblue, zernio, matrix, agentphone, lark, velt, kapso, linq), and community adapters as docs/adapter-community-<name>.md (webex, baileys, blooio, zalo, mattermost, weixin, cloudflare-do, mysql).
Upstream Sources
Sync & Update
When user runs sync: fetch latest from upstream sources, update docs/ files.
When user runs diff: compare current vs upstream, report changes.