Chat SDK
A unified TypeScript SDK for building chat bots and AI agents across every major messaging platform
Repository Health
Technical Analysis
Chat SDK (published to npm as chat) is a Vercel-maintained TypeScript framework for building chat bots once and deploying them across Slack, Microsoft Teams, Google Chat, Discord, Telegram, GitHub, Linear, WhatsApp, X, Messenger, and the web. A single Chat instance owns your bot’s event lifecycle (new mentions, subscribed messages, reactions, button clicks, slash commands) while platform-specific @chat-adapter/* packages translate that unified event model to and from each service’s native API. State persistence is similarly pluggable via @chat-adapter/state-* packages for Redis, ioredis, Postgres, or in-memory storage, and the bundled create-chat-sdk CLI scaffolds a ready-to-run Next.js bot project in one command.
What You Get
- A unified
Chatclass and event API (onNewMention,onSubscribedMessage,onReaction, etc.) shared identically across every supported chat platform - Official adapters for Slack, Microsoft Teams, Google Chat, Discord, Telegram, GitHub, Linear, WhatsApp, X, Messenger, and a generic web adapter
- Pluggable state backends (
@chat-adapter/state-redis,-ioredis,-pg,-memory) for persisting thread/conversation state independent of the messaging platform - AI-agent building blocks under the
chat/aisubpath, including tool definitions for wiring an LLM agent into the same bot event model - The
create-chat-sdkCLI, which scaffolds a Next.js bot app with webhook routes,.env.example, and dependencies for a chosen set of adapters
Common Use Cases
- Building a support or ops bot that needs to run identically across Slack and Microsoft Teams without maintaining two separate codebases
- Adding an AI agent to a team’s chat platform of choice, using the
aisubpath’s tool integration alongside a chosen adapter - Standing up a webhook-driven bot quickly via
create-chat-sdk, then incrementally adding more platform adapters as the bot grows - Building a GitHub or Linear bot that responds to mentions/comments using the same event-handling code style as a Slack or Discord bot
Under The Hood
Architecture The repo is a pnpm/Turborepo monorepo under packages/, with packages/chat as the core: src/chat.ts defines the Chat class and its event-subscription API, src/channel.ts and src/thread.ts model conversation channels/threads independent of platform, src/message-history.ts/thread-history.ts handle conversation state retrieval, and src/adapters defines the adapter contract that every @chat-adapter/* package implements against a specific platform’s webhook/API shape. src/ai/tools layers LLM tool-calling on top of the same channel/thread abstractions so an AI agent can post/react through the identical API a human-authored bot handler would use. src/jsx-runtime.ts supports a JSX-based message/card templating approach for building rich platform messages declaratively. The separate create-chat-sdk package is a project generator that scaffolds a Next.js app wired to chosen adapters. Tech Stack TypeScript throughout (88.65% of the repo), built with tsup for the core package’s dist output, pnpm workspaces plus Turborepo for monorepo task orchestration, Biome for linting/formatting, and Vitest for testing; apps/docs (MDX-heavy) hosts the chat-sdk.dev documentation site as part of the same monorepo. Code Quality packages/chat/src contains 23 .test.ts/.test.tsx files covering the channel/thread model, markdown and card rendering, JSX runtime, serialization, and streaming-plan logic; the monorepo also has a dedicated integration-tests package and tests package for cross-adapter verification. Recent, very active commit history (25/25 on development-activity and maintenance-consistency in the health score) indicates the project is under heavy active development rather than in maintenance mode. API Design The Chat class’s handler-registration API (onNewMention, onSubscribedMessage) is deliberately uniform across adapters, so switching or adding a target platform is largely a matter of registering a different adapter rather than rewriting bot logic; the README’s quickstart gets a working bot running in under 15 lines of code, and create-chat-sdk removes essentially all boilerplate for a first project, at the cost of an early v4.x API that is still evolving quickly (frequent releases, as reflected in the weekly-cadence changelog).
Used by 9 apps in this directory
Budibase
Low Code Platforms · No Code Platforms
Build AI agents, automations, and internal apps on a single open-source platform with full self-hosting control.
Cline
AI Code Assistants
An open-source AI coding agent that lives in your editor and terminal — reads and edits your codebase, runs commands, browses the web, and requires human approval for every action by default.
flue
AI Agents · Developer Tools
Build autonomous AI agents and powerful workflows with a programmable TypeScript harness that gives any model sessions, tools, sandboxes, and durable execution.
LobeHub
AI Assistants · Productivity · Automation
Your Chief Agent Operator — build, schedule, and collaborate with an entire AI team in one self-hostable workspace.
Mastra Code
AI Code Assistants
"A coding agent that never compacts" — a terminal-based AI coding agent built on the Mastra framework, with Observational Memory instead of context compaction, multi-model support, and OAuth login for Claude Max or ChatGPT Plus.
Midday
Invoicing Finance · Productivity
All-in-one AI-powered business operations platform for freelancers and solo entrepreneurs to manage invoicing, time tracking, banking, and financial intelligence.
n8n
Automation · No Code Platforms
Code when you need it, UI when you don't — the workflow automation platform built for technical teams who refuse to choose.
nao
AI Development · Analytics
Build and deploy an open-source analytics agent that understands your data warehouse and answers business questions in plain English.
Novu
Developer Tools
Open-source communication infrastructure that connects your products and AI agents to every channel your users live on — Inbox, Email, SMS, Push, Chat, and more.