Skip to content

Repository files navigation

Chat SDK

npm versionnpm downloadsLicense: MIT

A unified TypeScript SDK for building chat bots across Slack, Microsoft Teams, Google Chat, Discord, Telegram, GitHub, and Linear. Write your bot logic once, deploy everywhere.

Installation

npm install chat

Install adapters for your platforms:

npm install @chat-adapter/slack @chat-adapter/teams @chat-adapter/gchat @chat-adapter/discord @chat-adapter/telegram

Usage

import{Chat}from"chat";import{createSlackAdapter}from"@chat-adapter/slack";import{createRedisState}from"@chat-adapter/state-redis";constbot=newChat({userName: "mybot",adapters: {slack: createSlackAdapter(),},state: createRedisState(),});bot.onNewMention(async(thread)=>{awaitthread.subscribe();awaitthread.post("Hello! I'm listening to this thread.");});bot.onSubscribedMessage(async(thread,message)=>{awaitthread.post(`You said: ${message.text}`);});

See the Getting Started guide for a full walkthrough.

Supported platforms

PlatformPackageMentionsReactionsCardsModalsStreamingDMs
Slack@chat-adapter/slackYesYesYesYesNativeYes
Microsoft Teams@chat-adapter/teamsYesRead-onlyYesNoPost+EditYes
Google Chat@chat-adapter/gchatYesYesYesNoPost+EditYes
Discord@chat-adapter/discordYesYesYesNoPost+EditYes
Telegram@chat-adapter/telegramYesYesPartialNoPost+EditYes
GitHub@chat-adapter/githubYesYesNoNoNoNo
Linear@chat-adapter/linearYesYesNoNoNoNo

Features

  • Event handlers — mentions, messages, reactions, button clicks, slash commands, modals
  • AI streaming — stream LLM responses with native Slack streaming and post+edit fallback
  • Cards — JSX-based interactive cards (Block Kit, Adaptive Cards, Google Chat Cards)
  • Actions — handle button clicks and dropdown selections
  • Modals — form dialogs with text inputs, dropdowns, and validation
  • Slash commands — handle /command invocations
  • Emoji — type-safe, cross-platform emoji with custom emoji support
  • File uploads — send and receive file attachments
  • Direct messages — initiate DMs programmatically
  • Ephemeral messages — user-only visible messages with DM fallback

Packages

PackageDescription
chatCore SDK with Chat class, types, JSX runtime, and utilities
@chat-adapter/slackSlack adapter
@chat-adapter/teamsTeams adapter
@chat-adapter/gchatGoogle Chat adapter
@chat-adapter/discordDiscord adapter
@chat-adapter/telegramTelegram adapter
@chat-adapter/githubGitHub adapter
@chat-adapter/linearLinear adapter
@chat-adapter/state-redisRedis state adapter (production)
@chat-adapter/state-ioredisioredis state adapter (alternative)
@chat-adapter/state-memoryIn-memory state adapter (development)

AI coding agent support

If you use an AI coding agent like Claude Code, you can teach it about Chat SDK:

npx skills add vercel/chat

Documentation

Full documentation is available at chat-sdk.dev/docs.

Contributing

See CONTRIBUTING.md for development setup and the release process.

License

MIT

About

A unified TypeScript SDK for building chat bots across Slack, Microsoft Teams, Google Chat, Discord, and more.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages