chat-sdk

Build multi-platform chat bots with the Chat SDK TypeScript library.

Updated Aug 21, 2025
One-click install
npx skills add https://github.com/Adithiya-S/AI-Study-Companion --skill chat-sdk-adithiya-s
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: chat-sdk
Source: https://github.com/Adithiya-S/AI-Study-Companion/tree/main/.agents/skills/chat-sdk/upstream
Command: npx skills add https://github.com/Adithiya-S/AI-Study-Companion --skill chat-sdk-adithiya-s

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires chat, @chat-adapter/slack, @chat-adapter/teams, @chat-adapter/gchat, @chat-adapter/discord, @chat-adapter/github, @chat-adapter/linear, @chat-adapter/telegram, @chat-adapter/whatsapp, @chat-adapter/state-redis, @chat-adapter/state-pg, @chat-adapter/state-memory, @chat-adapter/state-ioredis.

What problem does it solve? Writing a bot for Slack, Teams, Discord, or other chat platforms normally means learning each platform's API, webhook format, and message model separately. This Skill provides guidance for the Chat SDK, a unified TypeScript library that lets you write bot logic once and deploy it across Slack, Teams, Google Chat, Discord, Telegram, GitHub, Linear, and WhatsApp. ## Core Features & Use Cases - Unified Event Handling: Route mentions, direct messages, subscribed thread replies, reactions, slash commands, button actions, and modal submissions through a single handler API. - Cross-Platform Adapters: Use official adapters for eight chat platforms plus state adapters for Redis, PostgreSQL, ioredis, or in-memory persistence. - Rich Interactions: Post JSX-based cards with buttons, selects, and tables, open modals, stream AI responses from the AI SDK, and handle file attachments. - Use Case: A developer wants a support bot that answers questions in both Slack and Discord. Using this Skill, they configure two adapters on one Chat instance, write a single onNewMention handler, and stream LLM responses to both platforms. ## Quick Start Ask the AI to scaffold a Chat SDK bot with a Slack adapter that responds to mentions and streams an AI reply into the thread.

Frequently Asked Questions about chat-sdk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a Slack bot with Chat SDK?

Create a Chat instance with createSlackAdapter from @chat-adapter/slack, register handlers like onNewMention, and wire bot.webhooks.slack to your HTTP framework route. Add a state adapter such as createRedisState for subscriptions and deduplication.

How do I stream AI responses to a chat thread?

Pass any AsyncIterable of strings to thread.post or thread.stream. With the AI SDK, prefer result.fullStream over result.textStream so step boundaries are preserved, and tune streamingUpdateIntervalMs for post-and-edit fallback cadence.

What chat platforms does Chat SDK support?

Official adapters cover Slack, Microsoft Teams, Google Chat, Discord, GitHub, Linear, Telegram, and WhatsApp Business Cloud. Community adapters add Matrix, iMessage, Webex, and others, with Instagram, Signal, X, and Messenger listed as coming soon.

Can one bot run on multiple chat platforms at once?

Yes. Register multiple adapters in the adapters object of a single Chat instance, and the same event handlers receive normalized threads and messages from every platform. Each adapter exposes its own webhook under bot.webhooks.

How do I build a custom Chat SDK adapter?

Read the contributing docs shipped in node_modules/chat/docs/contributing, then implement request verification, webhook parsing, message and thread operations, ID encoding, and a format converter using BaseFormatConverter from chat and utilities from @chat-adapter/shared.

Which state adapter should I use for persistence?

Use @chat-adapter/state-redis or state-ioredis for Redis backends, state-pg for PostgreSQL, or state-memory for local development. State adapters handle subscriptions, locks, deduplication, and thread state.