Development · Tip

Vercel Chat SDK Patterns and Code Snippets

Code patterns for building cross-platform chat bots with Vercel Chat SDK

A collection of practical code patterns illustrating how to build bots using Vercel's multi-platform Chat SDK in TypeScript. It demonstrates multi-adapter configuration, Redis state management, event subscription, and streaming LLM responses directly into chat threads.

How it works

Init: new Chat({userName:'mybot', adapters:{slack:createSlackAdapter()}, state:createRedisState()}); handlers onNewMention(async (thread) => {await thread.subscribe(); await thread.post("Hello!")}); onSubscribedMessage; onReaction([emoji.thumbs_up, emoji.heart]); posting via string/Markdown/AST/JSX; streaming ToolLoopAgent from 'ai' with anthropic/claude-4.5-sonnet, agent.stream + thread.post(result.textStream).

What it's for

  • Configure a single bot backend across Slack, Discord, Teams, or Google Chat
  • Persist conversation state across chat events using Redis adapters
  • Stream agentic LLM outputs directly into chat messages using Vercel AI SDK

Key points

  • Multi-adapter bot initialization supporting Slack and other chat platforms
  • State persistence integration using Redis
  • Event handlers for mentions, subscribed messages, and reaction triggers
  • Rich message rendering options including raw text, Markdown, AST, and JSX
  • Integration patterns with Vercel AI SDK streaming agents and Claude models

Pricing

Open source

Details

Type
Tip
Category
Development
Topic
AI Chatbots
Open source
Yes
Platforms
Code library
For
TypeScript developers building AI chat bots
Alternative to
Botpress, Bolt for JavaScript
Tags
bots, vercel, typescript, slack, ai sdk, streaming

Why it was saved

  • @haydenbleasel, 24 February 2026: Reference snippets for a Chat bot with Slack, state, reactions, streaming

Compare

Related

  • CustomGPT.ai

    No-code platform building custom AI chatbots from website sitemaps and business documents

  • DeepSeek

    Open-weights AI models and chat interface for reasoning, coding, and research.

  • DeepSeek Chat

    Conversational AI assistant with open-weights reasoning and general language models

  • Google Gemini

    Conversational AI assistant built on Google's large language models

  • Chat SDK 101

    Unified TypeScript SDK overview for multi-platform chat bot development

  • Chat SDK

    Universal TypeScript layer for building bots and agents across chat platforms

All 5 in AI Chatbots →

Updated