Chat SDK

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

Framework
npm
v4.38.1
2,299stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
84/100Excellent
Development Activity100
Maintenance100
Community68
Maturity28
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
79/100Good
Architecture82
Code Quality80
Innovation80
Learning Curve75

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 9 apps in this directory

TypeScript
69%
Other

Budibase

Low Code Platforms · No Code Platforms

28,220

Build AI agents, automations, and internal apps on a single open-source platform with full self-hosting control.

View details
92
Repo Health
81
Technical
63
Dependency
Built with
TypeScript69%
Svelte26%
Updated today
TypeScript
97%
Apache 2.0

Cline

AI Code Assistants

66,453

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.

View details
90
Repo Health
74
Technical
67
Dependency
Built with
TypeScript97%
Updated today
TypeScript
93%
Apache 2.0

flue

AI Agents · Developer Tools

7,953

Build autonomous AI agents and powerful workflows with a programmable TypeScript harness that gives any model sessions, tools, sandboxes, and durable execution.

View details
67
Repo Health
82
Technical
75
Dependency
Built with
TypeScript93%
Updated 1 weeks ago
TypeScript
99%
Other

LobeHub

AI Assistants · Productivity · Automation

81,816

Your Chief Agent Operator — build, schedule, and collaborate with an entire AI team in one self-hostable workspace.

View details
92
Repo Health
81
Technical
72
Dependency
Built with
TypeScript99%
Updated today
TypeScript
99%
Apache 2.0

Mastra Code

AI Code Assistants

27,294

"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.

View details
88
Repo Health
73
Technical
66
Dependency
Built with
TypeScript99%
Updated today
TypeScript
96%
AGPL 3.0

Midday

Invoicing Finance · Productivity

14,770

All-in-one AI-powered business operations platform for freelancers and solo entrepreneurs to manage invoicing, time tracking, banking, and financial intelligence.

View details
56
Repo Health
78
Technical
72
Dependency
Built with
TypeScript96%
Updated 2 months ago
TypeScript
92%
Other

n8n

Automation · No Code Platforms

201,152

Code when you need it, UI when you don't — the workflow automation platform built for technical teams who refuse to choose.

View details
95
Repo Health
87
Technical
66
Dependency
Built with
TypeScript92%
Updated today
TypeScript
80%
Apache 2.0

nao

AI Development · Analytics

1,570

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

View details
83
Repo Health
76
Technical
68
Dependency
Built with
TypeScript80%
Python19%
Updated yesterday
TypeScript
98%
Other

Novu

Developer Tools

39,615

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
65
Dependency
Built with
TypeScript98%
Updated today

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

Search