Chat SDK

A unified TypeScript SDK for building chat bots and AI agents across every major messaging platform

Framework
npm
v4.41.0
2,387 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
85 /100 Excellent
Development Activity 100
Maintenance 100
Community 68
Maturity 32
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
79 /100 Good
Architecture 82
Code Quality 80
Innovation 80
Learning Curve 75

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 Chat class 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/ai subpath, including tool definitions for wiring an LLM agent into the same bot event model
  • The create-chat-sdk CLI, 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 ai subpath’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 54 apps in this directory

TypeScript
83%
Apache 2.0

nao

AI Development · Analytics

1,702

Build and deploy an open-source analytics agent that understands your data warehouse and answers business questions in plain English.

View details
84
Repo Health
76
Technical
67
Dependency
Built with
TypeScript 83%
Python 17%
Updated 1 weeks ago
TypeScript
83%
Apache 2.0

nao

AI Development · Analytics

1,702

Build and deploy an open-source analytics agent that understands your data warehouse and answers business questions in plain English.

View details
84
Repo Health
76
Technical
67
Dependency
Built with
TypeScript 83%
Python 17%
Updated 1 weeks ago
TypeScript
83%
Apache 2.0

nao

AI Development · Analytics

1,702

Build and deploy an open-source analytics agent that understands your data warehouse and answers business questions in plain English.

View details
84
Repo Health
76
Technical
67
Dependency
Built with
TypeScript 83%
Python 17%
Updated 1 weeks ago
TypeScript
83%
Apache 2.0

nao

AI Development · Analytics

1,702

Build and deploy an open-source analytics agent that understands your data warehouse and answers business questions in plain English.

View details
84
Repo Health
76
Technical
67
Dependency
Built with
TypeScript 83%
Python 17%
Updated 1 weeks ago
TypeScript
83%
Apache 2.0

nao

AI Development · Analytics

1,702

Build and deploy an open-source analytics agent that understands your data warehouse and answers business questions in plain English.

View details
84
Repo Health
76
Technical
67
Dependency
Built with
TypeScript 83%
Python 17%
Updated 1 weeks ago
TypeScript
98%
Other

Novu

Developer Tools

40,084

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.

View details
93
Repo Health
80
Technical
64
Dependency
Built with
TypeScript 98%
Updated 6 days ago
TypeScript
98%
Other

Novu

Developer Tools

40,084

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.

View details
93
Repo Health
80
Technical
64
Dependency
Built with
TypeScript 98%
Updated 6 days ago
TypeScript
98%
Other

Novu

Developer Tools

40,084

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.

View details
93
Repo Health
80
Technical
64
Dependency
Built with
TypeScript 98%
Updated 6 days ago
TypeScript
98%
Other

Novu

Developer Tools

40,084

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.

View details
93
Repo Health
80
Technical
64
Dependency
Built with
TypeScript 98%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers