Skip to main content
Adapters are platform-specific implementations that connect the Chat SDK to messaging platforms. Each adapter handles:
  • Webhook verification - Validates incoming requests from the platform
  • Message parsing - Converts platform-specific formats to normalized SDK messages
  • API calls - Posts messages, adds reactions, manages threads
  • Format conversion - Transforms markdown/text between platform formats

Available Adapters

Slack

Connect to Slack workspaces with full multi-workspace support

Microsoft Teams

Integrate with Teams channels and DMs via Bot Framework

Google Chat

Build bots for Google Chat spaces with Workspace Events

Discord

Create Discord bots using HTTP Interactions or Gateway

Telegram

Build Telegram bots with webhook or long polling modes

GitHub

Respond to PR comments and review threads

Linear

Comment on Linear issues and participate in threads

Quick Start

1

Install adapter

Choose the platform adapter you need:
npm install @chat-adapter/slack
2

Create adapter instance

Configure with your platform credentials:
import { createSlackAdapter } from '@chat-adapter/slack';

const slack = createSlackAdapter({
  botToken: process.env.SLACK_BOT_TOKEN!,
  signingSecret: process.env.SLACK_SIGNING_SECRET!,
});
3

Add to Chat SDK

Initialize the Chat SDK with your adapter:
import { Chat } from 'chat';

const chat = new Chat({
  userName: 'my-bot',
  adapters: { slack },
  state: new MemoryState(),
});

await chat.initialize();
4

Handle webhooks

Route platform webhooks to your adapter:
app.post('/webhooks/slack', async (req, res) => {
  const response = await slack.handleWebhook(req);
  res.status(response.status).send(response.body);
});

Common Configuration

All adapters share these common configuration options:
OptionTypeDescription
loggerLoggerLogger instance for debugging and error tracking
userNamestringBot username for mention detection

Platform-Specific Features

Each platform has unique capabilities:
  • Multi-workspace - Slack, Teams (Azure AD multi-tenant), GitHub (app installations)
  • Threading - All platforms support thread/conversation isolation
  • Reactions - Slack, Discord, Teams, GitHub, Linear, Telegram
  • Cards/Rich UI - Slack (Block Kit), Teams (Adaptive Cards), Google Chat (Cards v2)
  • Files - Slack, Discord, Teams, Telegram
  • Typing indicators - Slack, Discord, Teams, Telegram

Thread ID Format

Each adapter uses a consistent thread ID format:
{platform}:{channel}:{thread}
Examples:
  • Slack: slack:C123ABC:1234567890.123456
  • Teams: teams:{base64(conversationId)}:{base64(serviceUrl)}
  • Discord: discord:@me:123456789 (DM)
  • Google Chat: gchat:spaces/ABC123:threads/xyz
  • Telegram: telegram:123456789 (chat ID)
  • GitHub: github:owner/repo:42 (PR #42)
  • Linear: linear:ISSUE-123:c:comment-id (comment thread)

Authentication Modes

Adapters support different authentication methods:

Single-tenant

One bot instance, one workspace/organization:
  • Fixed credentials in environment variables
  • Simpler setup, good for internal tools

Multi-tenant

One bot, multiple workspaces/organizations:
  • OAuth flow for user installation
  • Installation data stored in StateAdapter
  • Required for public apps
See individual adapter docs for platform-specific authentication details.

Error Handling

All adapters use standardized error types from @chat-adapter/shared:
  • ValidationError - Invalid input or configuration
  • AuthenticationError - Invalid credentials
  • PermissionError - Missing scopes or permissions
  • NetworkError - API request failed
  • AdapterRateLimitError - Rate limit exceeded
  • ResourceNotFoundError - Message/thread not found
import { AdapterRateLimitError } from '@chat-adapter/shared';

try {
  await thread.post('Hello!');
} catch (error) {
  if (error instanceof AdapterRateLimitError) {
    // Wait and retry
    await new Promise(r => setTimeout(r, error.retryAfter * 1000));
  }
}

Next Steps

Choose Your Platform

Pick an adapter from the list above and follow its setup guide

Message Handling

Learn how to process and respond to messages

Cards & Rich UI

Build interactive cards for supported platforms

State Management

Store subscriptions and bot data across requests