Development · Tip

Chat SDK 101

Unified TypeScript SDK overview for multi-platform chat bot development

This reference outlines the core architecture and usage patterns of Vercel's Chat SDK for TypeScript. It covers how to route events and build bots across Slack, Microsoft Teams, Google Chat, and Discord using unified adapters and handlers. It also details native streaming support alongside the Vercel AI SDK and pluggable state management.

How it works

Main entry: Chat class that coordinates adapters and routes events. Adapters: Slack, Teams, Google Chat, Discord — createSlackAdapter etc. State: pluggable layer, createRedisState. Handlers: bot.onNewMention, bot.onSubscribedMessage, bot.onReaction, thread.subscribe/post/startTyping, channel.post. Posting formats: plain string, Markdown, structured AST (root/paragraph/text/strong/link), and JSX (Card, Text, Actions, Button). Streaming: pass AI SDK textStream to thread.post; supports ToolLoopAgent from 'ai' (anthropic/claude-4.5-sonnet). Guides: Slack bot with Next.js + Redis, Discord support bot with Nuxt + AI SDK, code review bot with Hono + Vercel Sandbox. Install the Chat SDK skill: npx skills add vercel/chat.

What it's for

  • Build cross-platform conversational bots for Slack, Teams, Google Chat, and Discord with a single codebase
  • Stream LLM completions into chat threads using Vercel AI SDK integration
  • Persist bot conversational context across channels using pluggable state adapters like Redis

Key points

  • Core Chat coordinator class for unified adapter routing
  • Prebuilt adapters for Slack, Discord, Google Chat, and Microsoft Teams
  • Pluggable state persistence layer including Redis support
  • Unified event handlers for mentions, subscribed messages, and reactions
  • Flexible output rendering via plain text, Markdown, structured ASTs, or JSX components
  • Native stream handling for AI SDK text streams and ToolLoopAgent

Pricing

Open source

Details

Type
Tip
Category
Development
Topic
Bot Development
Open source
Yes
Platforms
Code library
For
TypeScript developers building AI agents and chat bots across team messaging platforms
Alternative to
Botpress, Microsoft Bot Framework
Tags
typescript, bots, slack, discord, ai sdk, vercel

Why it was saved

  • @haydenbleasel, 24 February 2026: Codebase for building bots across Slack, Teams, Google Chat, Discord — reusable patterns and guides

Compare

Related

Updated