chat-sdk

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

Updated Sep 17, 2026
One-click install
npx skills add https://github.com/ridhijain709/AIPORSCHE --skill chat-sdk-ridhijain709
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: chat-sdk
Source: https://github.com/ridhijain709/AIPORSCHE/tree/main/.agents/skills/chat-sdk/upstream
Command: npx skills add https://github.com/ridhijain709/AIPORSCHE --skill chat-sdk-ridhijain709

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-ioredis, @chat-adapter/state-memory.

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. Chat SDK provides a unified TypeScript interface so bot logic is written once and deployed across Slack, Teams, Google Chat, Discord, Telegram, GitHub, Linear, and WhatsApp. ## Core Features & Use Cases - Unified event handling: Register handlers for mentions, direct messages, subscribed thread messages, reactions, slash commands, button actions, and modal submissions through one Chat instance. - Cross-platform adapters: Official adapters for eight chat platforms plus state adapters for Redis, PostgreSQL, ioredis, and in-memory persistence with locking and deduplication. - Rich messaging and AI streaming: Post JSX-based cards and modals, stream AI SDK responses directly into threads, and build custom adapters using documented authoring guides. - Use Case: A developer builds a support bot that answers questions in Slack and Discord, streams LLM responses into threads, and persists thread subscriptions in Redis without writing platform-specific code. ## Quick Start Ask the AI to scaffold a Chat SDK bot with a Slack adapter that responds to new mentions by posting a greeting and subscribing to 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 dedupe.

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 during streaming.

Which 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 I use Chat SDK with Next.js or Nuxt webhook routes?

Yes. Each registered adapter exposes bot.webhooks.<name>, which you wire directly to your framework's HTTP routes. Published guides cover Slack with Next.js and Discord with Nuxt route patterns.

How do I persist thread state and prevent duplicate messages?

Use an official state adapter such as @chat-adapter/state-redis, state-pg, state-ioredis, or state-memory. These handle subscriptions, locks, and dedupe, with dedupeTtlMs configuring the deduplication window.

How do I build a custom Chat SDK adapter?

Read the contributing docs shipped in node_modules/chat/docs/contributing and inspect the Adapter interfaces in dist/index.d.ts. A custom adapter needs request verification, webhook parsing, message operations, ID encoding, and a format converter built on BaseFormatConverter.