
Chat SDK adds X adapter support
Quick Answer
Chat SDK now integrates support for X (Twitter) with a new adapter, allowing teams to create bots that respond to public mentions and direct messages using the X API v2.
Quick Take
Chat SDK now integrates support for X (Twitter) with a new adapter, allowing teams to create bots that respond to public mentions and direct messages using the X API v2. The adapter automates CRC verification, webhook signature checks, and OAuth token refresh for long-running bots, enhancing multi-platform bot development.
Key Points
- New X adapter enables bot interactions on Twitter alongside Slack, Discord, and more.
- Bots can respond to public mentions and direct messages using X API v2.
- Adapter automates CRC verification and webhook signature checks.
- OAuth token refresh is managed for long-running bot sessions.
- Only likes are supported as reactions, with no native streaming on X.
📖 Reader Mode
~1 min readChat SDK now supports X (Twitter), extending its single-codebase approach to Slack, Discord, GitHub, Teams, Telegram, and WhatsApp with the new X adapter.
Teams can build bots that reply to public mentions and hold direct message conversations through the X API v2 and the X Activity API. The adapter handles CRC verification and webhook signature checks automatically and can manage OAuth token refresh for long-running bots.
lib/bot.ts
import { Chat } from "chat";
import { createXAdapter } from "@chat-adapter/x";
const bot = new Chat({
userName: "mybot",
adapters: {
x: createXAdapter(),
},
});
bot.onNewMention(async (thread, message) => {
await thread.post(`Hi @${message.author.userName}!`);
});
Configure the adapter to respond to @-mentions on X
Likes are the only supported reaction, and responses post once on completion since X has no native streaming. X's automation rules apply to automated messages.
Read the documentation to get started, browse the directory, or build your own.
The Complete Guide to Chat SDK
Learn how Chat SDK works end-to-end: from core concepts to building your first bot to deploying it across platforms.
Read the guide
— Originally published at vercel.com
Want this in your inbox every morning?
Daily brief at your local 8am — bilingual EN/中文, free.
More from Vercel AI
See more →
The Agent Stack
The Agent Stack by Vercel AI provides essential building blocks for creating production-grade agents, enabling seamless integration across multiple AI models and secure operations. It features components like AI Gateway for model routing, Workflow SDK for durable execution, and Vercel Connect for scoped access, streamlining agent development and deployment across various platforms.

