惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

O
OpenAI News
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园_首页
博客园 - 三生石上(FineUI控件)
美团技术团队
博客园 - 叶小钗
博客园 - 司徒正美
Jina AI
Jina AI
Apple Machine Learning Research
Apple Machine Learning Research
The Cloudflare Blog
博客园 - 聂微东
博客园 - 【当耐特】
罗磊的独立博客
月光博客
月光博客
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
小众软件
小众软件
P
Privacy International News Feed
V
V2EX
T
The Exploit Database - CXSecurity.com
有赞技术团队
有赞技术团队
T
Tailwind CSS Blog
A
Arctic Wolf
T
Threatpost
博客园 - Franky
The Hacker News
The Hacker News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
G
GRAHAM CLULEY
H
Hacker News: Front Page
雷峰网
雷峰网
C
Cybersecurity and Infrastructure Security Agency CISA
J
Java Code Geeks
P
Palo Alto Networks Blog
H
Heimdal Security Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
V
Vulnerabilities – Threatpost
The Last Watchdog
The Last Watchdog
T
Tor Project blog
爱范儿
爱范儿
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
IT之家
IT之家
C
Cisco Blogs
www.infosecurity-magazine.com
www.infosecurity-magazine.com
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
腾讯CDC
V
Visual Studio Blog
S
Schneier on Security
大猫的无限游戏
大猫的无限游戏
T
Threat Research - Cisco Blogs

Chat SDK Documentation

Teams Low-Level APIs | Chat SDK CLI | Chat SDK State Adapters | Chat SDK Cards | Chat SDK Getting Started | Chat SDK Introduction | Chat SDK Modals | Chat SDK Slack Low-Level APIs | Chat SDK Streaming | Chat SDK Testing | Chat SDK Overview | Chat SDK toAiMessages | Chat SDK Cards | Chat SDK Overview | Chat SDK Markdown | Chat SDK Modals | Chat SDK AI SDK Tools | Chat SDK Types | Chat SDK Message Subject | Chat SDK Conversation History | Chat SDK Transcripts | Chat SDK Slack bot with Next.js and Redis Actions | Chat SDK Direct Messages | Chat SDK Emoji | Chat SDK Error Handling | Chat SDK File Uploads | Chat SDK Handling Events | Chat SDK Posting Messages | Chat SDK Slash Commands | Chat SDK State Adapters | Chat SDK Threads, Messages, and Channels | Chat SDK Creating a Chat Instance | Chat SDK WhatsApp Business Cloud Channel | Chat SDK Chat | Chat SDK Platform Adapters | Chat SDK Overlapping Messages | Chat SDK Ephemeral Messages | Chat SDK Message | Chat SDK Thread | Chat SDK Building a community adapter | Chat SDK Documenting your adapter | Chat SDK Publishing your adapter | Chat SDK Testing adapters | Chat SDK Code review GitHub bot with Hono and Redis Discord support bot with Nuxt and Redis Durable chat sessions with Next.js, Workflow, and Redis Schedule Slack posts with Next.js, Workflow, and Neon PostableMessage | Chat SDK
Platform Adapters | Chat SDK
Vercel · 2026-06-16 · via Chat SDK Documentation

Platform-specific adapters that connect your bot to any messaging platform.

Platform adapters handle webhook verification, message parsing, and API calls for each messaging platform. Install only the adapters you need. Browse all available adapters, including community-built ones, on the Adapters page.

Need a browser chat UI? See the Web adapter. It speaks the AI SDK UI stream protocol and works with React (@ai-sdk/react), Vue (@ai-sdk/vue), and Svelte (@ai-sdk/svelte), so the same bot serves Slack, Teams, and any browser framework out of the box.

Ready to build your own? Follow the building guide.

Messaging

Rich content

FeatureDiscordGoogle ChatGitHubLinearMessengerSlackMicrosoft TeamsTelegramTwilioWebWhatsApp Business Cloud
Card formatEmbedsGoogle Chat CardsGFM MarkdownMarkdownGeneric / Button TemplatesBlock KitAdaptive CardsMarkdownV2 + inline keyboardPlain text fallbackMarkdown only (v1)WhatsApp templates
ButtonsMax 3, postbackInline keyboardInteractive replies
Link buttonsweb_urlInline keyboard URLs
Select menus
TablesGFMASCIIGFMGFMASCIIBlock KitGFMNative messages / ASCII cardsASCIIGFM
FieldsASCIITemplate variables
Images in cards
Modals

Conversations

Message history

Messaging

FeatureSlackTeamsGoogle ChatDiscordTelegramGitHubLinearWhatsAppMessenger
Post message
Edit message Partial
Delete message Partial
File uploads Single file/media Images, audio, docs
Streaming Native Native (DMs) / Buffered Post+Edit Post+Edit Rich drafts / Post+Edit Buffered Agent sessions / Post+Edit Buffered Buffered
Scheduled messages Native

Rich content

FeatureSlackTeamsGoogle ChatDiscordTelegramGitHubLinearWhatsAppMessenger
Card formatBlock KitAdaptive CardsGoogle Chat CardsEmbedsMarkdown + inline keyboard buttonsGFM MarkdownMarkdownWhatsApp templatesGeneric/Button Templates
Buttons Inline keyboard callbacks Interactive replies Max 3, postback
Link buttons Inline keyboard URLs
Select menus
Tables Block Kit GFM ASCII GFM Native messages / ASCII cards GFM GFM ASCII
Fields Template variables ASCII
Images in cards
Modals

Conversations

FeatureSlackTeamsGoogle ChatDiscordTelegramGitHubLinearWhatsAppMessenger
Slash commands
Mentions
Add reactions
Remove reactions
Typing indicator Agent sessions
DMs
Ephemeral messages Native Native
User lookup (getUser) Cached Cached Seen users
Parent subject (message.subject)
Native client (.webClient / .octokit / .linearClient)
Custom API endpoint (apiUrl)

Message history

FeatureSlackTeamsGoogle ChatDiscordTelegramGitHubLinearWhatsAppMessenger
Fetch messages Cached Cached sent messages only Cached sent messages only
Fetch single message Cached Cached
Fetch thread info
Fetch channel messages Cached Cached
List threads
Fetch channel info
Post channel message

indicates partial support. The feature works with limitations. See individual adapter pages for details.

Each adapter implements a standard interface that the Chat class uses to route events and send messages. When a webhook arrives:

  1. The adapter verifies the request signature
  2. Parses the platform-specific payload into a normalized Message
  3. Routes to your handlers via the Chat class
  4. Converts outgoing messages from markdown/AST/cards to the platform's native format

Register multiple adapters and your event handlers work across all of them:

import { Chat } from "chat";
import { createSlackAdapter } from "@chat-adapter/slack";
import { createTeamsAdapter } from "@chat-adapter/teams";
import { createGoogleChatAdapter } from "@chat-adapter/gchat";
import { createRedisState } from "@chat-adapter/state-redis";

const bot = new Chat({
  userName: "mybot",
  adapters: {
    slack: createSlackAdapter(),
    teams: createTeamsAdapter(),
    gchat: createGoogleChatAdapter(),
  },
  state: createRedisState(),
});

// This handler fires for mentions on any platform
bot.onNewMention(async (thread) => {
  await thread.subscribe();
  await thread.post("Hello!");
});

Each adapter auto-detects credentials from environment variables, so you only need to pass config when overriding defaults.

The examples above use Redis for state. See State Adapters for all available options.

Each adapter creates a webhook handler accessible via bot.webhooks.<name>.

Each official adapter exposes its extension surface as protected members so you can subclass it to override or extend platform-specific behavior without forking the package. Use this when you need to handle a payload type the built-in adapter doesn't cover, intercept verification, or wrap an existing handler.

import { TelegramAdapter, type TelegramUpdate } from "@chat-adapter/telegram";
import type { WebhookOptions } from "chat";

export class CustomTelegramAdapter extends TelegramAdapter {
  protected override processUpdate(
    update: TelegramUpdate,
    options?: WebhookOptions
  ): void {
    // Handle a payload type the base adapter doesn't, e.g. chat_join_request.
    if ("chat_join_request" in update) {
      this.logger.info("Received chat_join_request", { update });
      return;
    }
    super.processUpdate(update, options);
  }
}

Construct your subclass anywhere you'd construct the base adapter, for example, adapters: { telegram: new CustomTelegramAdapter({ ... }) }. Members marked private intentionally remain inaccessible. If you find a hook you need that isn't protected, please open an issue.

The protected extension surface is intentionally broader than the public API but is not yet considered fully stable. Method signatures may evolve in minor releases as we learn from real-world subclasses. Pin the adapter version you build against, watch the changelog for the affected adapter, and prefer overriding the smallest hook that solves your problem so upgrades stay easy. If you rely on a particular hook, please open an issue so we can promote it to a stable, documented extension point.