# Chat Bot SDK

Builds multi-platform chat bots with webhooks, mentions, slash commands and streaming.

- Repository: https://github.com/lobehub/lobehub (83676 stars)
- Category: AI and agents
- License: see repository
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add lobehub/lobehub --skill chat-sdk -g -a claude-code -y`
Codex: `npx skills add lobehub/lobehub --skill chat-sdk -g -a codex -y`
Cursor: `npx skills add lobehub/lobehub --skill chat-sdk -g -a cursor -y`
Gemini CLI: `npx skills add lobehub/lobehub --skill chat-sdk -g -a gemini-cli -y`

## Description

Use for multi-platform bots built with chat SDK: webhooks, mentions, slash commands, cards, modals and streaming.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Chat SDK

Unified TypeScript SDK for building chat bots across Slack, Teams, Google Chat, Discord, GitHub, and Linear. Write bot logic once, deploy everywhere.

## Critical: Read the bundled docs

The `chat` package ships with full documentation in `node_modules/chat/docs/` and TypeScript source types. **Always read these before writing code:**

```
node_modules/chat/docs/           # Full documentation (MDX files)
node_modules/chat/dist/           # Built types (.d.ts files)
```

Key docs to read based on task:

- `docs/getting-started.mdx`, setup guides
- `docs/usage.mdx`, event handlers, threads, messages, channels
- `docs/streaming.mdx`, AI streaming with AI SDK
- `docs/cards.mdx`, JSX interactive cards
- `docs/actions.mdx`, button/dropdown handlers
- `docs/modals.mdx`, form dialogs (Slack only)
- `docs/adapters.mdx`, `docs/platform-adapters.mdx`, adapter overview and platform-specific setup
- `docs/state-adapters.mdx`, state adapter config (Redis, ioredis, memory)

Also read the TypeScript types from `node_modules/chat/dist/` to understand the full API surface.

## Quick start

```typescript
import { Chat } from 'chat';
import { createSlackAdapter } from '@chat-adapter/slack';
import { createRedisState } from '@chat-adapter/state-redis';

const bot = new Chat({
  userName: 'mybot',
  adapters: {
    slack: createSlackAdapter({
      botToken: process.env.SLACK_BOT_TOKEN!,
      signingSecret: process.env.SLACK_SIGNING_SECRET!,
    }),
  },
  state: createRedisState({ url: process.env.REDIS_URL! }),
});

bot.onNewMention(async (thread) => {
  await thread.subscribe();
  await thread.post("Hello! I'm listening to this thread.");
});

bot.onSubscribedMessage(async (thread, message) => {
  await thread.post(`You said: ${message.text}`);
});
```

## Core concepts

The rest: https://github.com/lobehub/lobehub/blob/HEAD/.agents/skills/chat-sdk/SKILL.md
