chat-sdk

Build multi-platform chat bots with a unified TypeScript SDK for Slack, Teams, and Discord.

Updated Jan 27, 2026
One-click install
npx skills add https://github.com/SmallAi-API/smaihub --skill chat-sdk-smallai-api
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: chat-sdk
Source: https://github.com/SmallAi-API/smaihub/tree/main/.agents/skills/chat-sdk
Command: npx skills add https://github.com/SmallAi-API/smaihub --skill chat-sdk-smallai-api

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/state-redis.

What problem does it solve? Writing chat bots separately for Slack, Teams, Google Chat, Discord, GitHub, and Linear means duplicating logic across incompatible APIs. This Skill provides a unified TypeScript SDK so bot logic is written once and deployed across all supported platforms. ## Core Features & Use Cases - Unified Event Handling: Register handlers for mentions, subscribed messages, slash commands, reactions, button actions, and slash commands through one consistent API. - Streaming AI Responses: Pass any AsyncIterable, such as an AI SDK textStream, directly to thread.post for live-streamed bot replies. - JSX Cards and Modals: Compose interactive cards with buttons, selects, and fields using JSX components rendered per platform. - Use Case: Build a support bot that responds to @-mentions in Slack and Teams, streams LLM answers into threads, and presents approval buttons via interactive cards, all from a single codebase. ## Quick Start Use the chat-sdk skill to scaffold a Slack bot that replies to new mentions and streams an AI response 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 the chat TypeScript SDK?

Create a Chat instance with createSlackAdapter using your bot token and signing secret, then register handlers like onNewMention. Wire bot.webhooks.slack to an HTTP route in frameworks like Next.js, Hono, or Express.

How to stream AI responses into chat threads?

Pass any AsyncIterable of strings to thread.post, including the textStream from the AI SDK's agent.stream call. The SDK handles progressive message updates across supported platforms automatically.

Which chat platforms does the chat SDK support?

The SDK supports Slack, Microsoft Teams, Google Chat, Discord, GitHub Issues, and Linear Issues through dedicated @chat-adapter packages. Bot logic is written once against the unified Chat API and runs on all configured adapters.

Does the chat SDK support interactive cards and buttons?

Yes, set jsxImportSource to chat in tsconfig and use components like Card, Button, Actions, Select, and Fields. Button clicks and dropdown selections are handled through the onAction handler. Modals are supported on Slack only.

What state storage options exist for production chat bots?

Use @chat-adapter/state-redis or @chat-adapter/state-ioredis for production deployments, configured with a Redis URL. The @chat-adapter/state-memory package provides in-memory state suitable for local development only.