mirror of
https://github.com/vercel/chat.git
synced 2026-09-14 18:32:29 +08:00
ef2542c5fd
## summary
new `@chat-adapter/x` adapter for X (Twitter), built on the X API v2 and
the X Activity API. write bot logic once and reply to mentions, hold DM
conversations, post from the account, and like posts, like the other
Chat SDK adapters
what it supports:
- reply to public mentions (`post.mention.create`) and top-level posts
via `channel.post`
- send and receive direct messages (`dm.received` / `dm.sent`)
- edit and delete owned posts, delete own DM events
- likes as the only reaction (`emoji.heart` or `"like"`)
- buffered streaming: accumulates an LLM stream and posts once instead
of post+edit churn on a public timeline
- OAuth 2.0 user context with managed token refresh (rotating refresh
token persisted in the state adapter, optional AES-256-GCM encryption)
- webhook CRC and `x-twitter-webhooks-signature` verification
key design decisions:
- DMs are threaded by the other participant's user id (`x:dm:{userId}`)
because X DM webhooks carry no conversation id, only participants
- OAuth 2.0 only at runtime: DM send and read are verified to work on
OAuth 2.0 user tokens, so no OAuth 1.0a in the adapter (subscription and
webhook setup is one-time and handled in the X developer console)
- parsers were written against real captured payloads: mentions use the
v2 shape (author hydrated in `includes.users`), DMs use the legacy
Account Activity shape (`direct_message_events`,
`message_create.message_data`, a `users` map, and no conversation id)
also includes the `chat/adapters` catalog entry, docs page, CLI scaffold
spec, and `sample-messages.md` with real captured payloads
<details><summary>usage</summary>
```typescript
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}!`);
});
bot.onDirectMessage(async (thread) => {
await thread.post("hello from X");
});
```
</details>
## test plan
- adapter unit tests pass against the real captured payload shapes, with
regression tests for author-from-`includes` (mentions) and the legacy
`direct_message_events` shape (DMs)
- real captured `post.mention.create` and `dm.received` payloads
verified end-to-end through `handleWebhook`: signature verification,
routing, author resolution, and participant threading, plus
bad-signature rejection returns 401
- every write and read path fired live against the X API through the
adapter: top-level post, reply to a mention, like and unlike, edit,
delete, DM send, DM read, DM delete
- OAuth 2.0 managed token refresh exercised live (access and refresh
token rotation)
---------
Signed-off-by: dancer <josh@afterima.ge>
407 lines
15 KiB
JSON
407 lines
15 KiB
JSON
[
|
|
{
|
|
"name": "Slack",
|
|
"slug": "slack",
|
|
"type": "platform",
|
|
"description": "Build bots for Slack workspaces with full support for threads, reactions, and interactive messages.",
|
|
"packageName": "@chat-adapter/slack",
|
|
"icon": "slack",
|
|
"beta": true,
|
|
"readme": "https://github.com/vercel/chat/tree/main/packages/adapter-slack"
|
|
},
|
|
{
|
|
"name": "Microsoft Teams",
|
|
"slug": "teams",
|
|
"type": "platform",
|
|
"description": "Deploy bots to Microsoft Teams with adaptive cards, mentions, and conversation threading.",
|
|
"packageName": "@chat-adapter/teams",
|
|
"icon": "teams",
|
|
"beta": true,
|
|
"readme": "https://github.com/vercel/chat/tree/main/packages/adapter-teams"
|
|
},
|
|
{
|
|
"name": "Google Chat",
|
|
"slug": "gchat",
|
|
"type": "platform",
|
|
"description": "Integrate with Google Chat spaces for team collaboration and automated workflows.",
|
|
"packageName": "@chat-adapter/gchat",
|
|
"icon": "gchat",
|
|
"beta": true,
|
|
"readme": "https://github.com/vercel/chat/tree/main/packages/adapter-gchat"
|
|
},
|
|
{
|
|
"name": "Discord",
|
|
"slug": "discord",
|
|
"type": "platform",
|
|
"description": "Create Discord bots with slash commands, threads, and rich embeds.",
|
|
"packageName": "@chat-adapter/discord",
|
|
"icon": "discord",
|
|
"beta": true,
|
|
"readme": "https://github.com/vercel/chat/tree/main/packages/adapter-discord"
|
|
},
|
|
{
|
|
"name": "GitHub",
|
|
"slug": "github",
|
|
"type": "platform",
|
|
"description": "Build bots that respond to pull request and issue comment threads.",
|
|
"packageName": "@chat-adapter/github",
|
|
"icon": "github",
|
|
"beta": true,
|
|
"readme": "https://github.com/vercel/chat/tree/main/packages/adapter-github"
|
|
},
|
|
{
|
|
"name": "Linear",
|
|
"slug": "linear",
|
|
"type": "platform",
|
|
"description": "Automate Linear issue comment threads with bot responses and workflows.",
|
|
"packageName": "@chat-adapter/linear",
|
|
"icon": "linear",
|
|
"beta": true,
|
|
"readme": "https://github.com/vercel/chat/tree/main/packages/adapter-linear"
|
|
},
|
|
{
|
|
"name": "Telegram",
|
|
"slug": "telegram",
|
|
"type": "platform",
|
|
"description": "Connect to Telegram with support for groups, channels, and inline keyboards.",
|
|
"packageName": "@chat-adapter/telegram",
|
|
"icon": "telegram",
|
|
"beta": true,
|
|
"readme": "https://github.com/vercel/chat/tree/main/packages/adapter-telegram"
|
|
},
|
|
{
|
|
"name": "WhatsApp Business Cloud",
|
|
"slug": "whatsapp",
|
|
"type": "platform",
|
|
"icon": "whatsapp",
|
|
"description": "Connect to WhatsApp Business Cloud for customer messaging and automated conversations.",
|
|
"packageName": "@chat-adapter/whatsapp",
|
|
"beta": true,
|
|
"readme": "https://github.com/vercel/chat/tree/main/packages/adapter-whatsapp"
|
|
},
|
|
{
|
|
"name": "Twilio",
|
|
"slug": "twilio",
|
|
"type": "platform",
|
|
"icon": "twilio",
|
|
"description": "Build SMS and MMS bots with Twilio Messaging webhooks and the Messages API.",
|
|
"packageName": "@chat-adapter/twilio",
|
|
"beta": true,
|
|
"readme": "https://github.com/vercel/chat/tree/main/packages/adapter-twilio"
|
|
},
|
|
{
|
|
"name": "X",
|
|
"slug": "x",
|
|
"type": "platform",
|
|
"description": "Reply to public mentions and hold direct message conversations on X (Twitter) with the X API v2.",
|
|
"packageName": "@chat-adapter/x",
|
|
"icon": "x",
|
|
"beta": true,
|
|
"readme": "https://github.com/vercel/chat/tree/main/packages/adapter-x"
|
|
},
|
|
{
|
|
"name": "Messenger",
|
|
"slug": "messenger",
|
|
"type": "platform",
|
|
"description": "Build bots for Facebook Messenger with support for templates, buttons, reactions, and postbacks.",
|
|
"packageName": "@chat-adapter/messenger",
|
|
"icon": "messenger",
|
|
"beta": true,
|
|
"readme": "https://github.com/vercel/chat/tree/main/packages/adapter-messenger"
|
|
},
|
|
{
|
|
"name": "Web",
|
|
"slug": "web",
|
|
"type": "platform",
|
|
"description": "Serve a browser chat UI from the same bot using the AI SDK useChat protocol \u2014 works out of the box with @ai-sdk/react and ai-elements.",
|
|
"packageName": "@chat-adapter/web",
|
|
"icon": "web",
|
|
"beta": true,
|
|
"readme": "https://github.com/vercel/chat/tree/main/packages/adapter-web"
|
|
},
|
|
{
|
|
"name": "Redis",
|
|
"slug": "redis",
|
|
"type": "state",
|
|
"description": "Production-ready state adapter using Redis for persistence and distributed locking.",
|
|
"packageName": "@chat-adapter/state-redis",
|
|
"icon": "redis",
|
|
"beta": true,
|
|
"readme": "https://github.com/vercel/chat/tree/main/packages/state-redis"
|
|
},
|
|
{
|
|
"name": "ioredis",
|
|
"slug": "ioredis",
|
|
"type": "state",
|
|
"description": "Redis state adapter using ioredis with cluster and sentinel support.",
|
|
"packageName": "@chat-adapter/state-ioredis",
|
|
"icon": "ioredis",
|
|
"beta": true,
|
|
"readme": "https://github.com/vercel/chat/tree/main/packages/state-ioredis"
|
|
},
|
|
{
|
|
"name": "PostgreSQL",
|
|
"slug": "postgres",
|
|
"type": "state",
|
|
"description": "Production state adapter using PostgreSQL for persistence and distributed locking.",
|
|
"packageName": "@chat-adapter/state-pg",
|
|
"icon": "postgres",
|
|
"beta": true,
|
|
"readme": "https://github.com/vercel/chat/tree/main/packages/state-pg"
|
|
},
|
|
{
|
|
"name": "Memory",
|
|
"slug": "memory",
|
|
"type": "state",
|
|
"description": "In-memory state adapter for development and testing environments.",
|
|
"packageName": "@chat-adapter/state-memory",
|
|
"icon": "memory",
|
|
"beta": true,
|
|
"readme": "https://github.com/vercel/chat/tree/main/packages/state-memory"
|
|
},
|
|
{
|
|
"name": "Cloudflare Durable Objects",
|
|
"slug": "cloudflare-do",
|
|
"type": "state",
|
|
"community": true,
|
|
"description": "Cloudflare Durable Objects state adapter with SQLite-backed persistence, distributed locking, and caching.",
|
|
"packageName": "chat-state-cloudflare-do",
|
|
"author": "dcartertwo",
|
|
"readme": "https://github.com/dcartertwo/chat-state-cloudflare-do/tree/13ebf545b302b7c8fdabf7de9c5de678e047ce5e"
|
|
},
|
|
{
|
|
"name": "Cloudflare Agents",
|
|
"slug": "cloudflare-agents",
|
|
"type": "state",
|
|
"community": true,
|
|
"description": "Cloudflare Agents state adapter for Chat SDK. Stores subscriptions, locks, queues, and history in Durable Object SQLite via ChatSdkStateAgent sub-agents.",
|
|
"packageName": "agents",
|
|
"author": "Cloudflare",
|
|
"readme": "https://github.com/cloudflare/agents",
|
|
"vendorOfficial": true
|
|
},
|
|
{
|
|
"name": "MySQL",
|
|
"slug": "mysql",
|
|
"type": "state",
|
|
"community": true,
|
|
"description": "Community MySQL state adapter with persistence, distributed locking, caching, lists, and queues.",
|
|
"packageName": "chat-state-mysql",
|
|
"author": "DivyanshGolyan",
|
|
"readme": "https://github.com/DivyanshGolyan/chat-state-mysql/tree/26502f2c43e2aee16b0b58f2066a81e01b2c289b"
|
|
},
|
|
{
|
|
"name": "Liveblocks",
|
|
"slug": "liveblocks",
|
|
"type": "platform",
|
|
"community": true,
|
|
"description": "Liveblocks Comments adapter for building conversational bots on top of Liveblocks rooms, threads, and comments.",
|
|
"packageName": "@liveblocks/chat-sdk-adapter",
|
|
"author": "Liveblocks",
|
|
"readme": "https://github.com/liveblocks/liveblocks/tree/a939486c73819ea78a96443d54cb5557881d80b6/packages/liveblocks-chat-sdk-adapter",
|
|
"vendorOfficial": true
|
|
},
|
|
{
|
|
"name": "Resend",
|
|
"slug": "resend",
|
|
"type": "platform",
|
|
"community": true,
|
|
"description": "Bidirectional email adapter for Chat SDK with threading, rich HTML emails, and attachment support via Resend.",
|
|
"packageName": "@resend/chat-sdk-adapter",
|
|
"author": "Resend",
|
|
"readme": "https://github.com/resend/resend-chat-sdk/tree/6b66fc12eabdf2529422fc0c0cf946392f1b5a76",
|
|
"vendorOfficial": true
|
|
},
|
|
{
|
|
"name": "Sendblue",
|
|
"slug": "sendblue",
|
|
"type": "platform",
|
|
"community": true,
|
|
"description": "iMessage, SMS, and RCS adapter for Chat SDK, built and maintained by Sendblue.",
|
|
"packageName": "chat-adapter-sendblue",
|
|
"author": "Sendblue",
|
|
"readme": "https://github.com/sendblue-api/chat-adapter-sendblue",
|
|
"vendorOfficial": true
|
|
},
|
|
{
|
|
"name": "Zernio",
|
|
"slug": "zernio",
|
|
"type": "platform",
|
|
"community": true,
|
|
"description": "Unified social media DM adapter covering Instagram, Facebook, Telegram, WhatsApp, X/Twitter, Bluesky, and Reddit through a single integration.",
|
|
"packageName": "@zernio/chat-sdk-adapter",
|
|
"author": "Zernio",
|
|
"readme": "https://github.com/zernio-dev/chat-sdk-adapter/tree/0a51a1d224536ae5d117a3afb6ab992fab167214",
|
|
"vendorOfficial": true
|
|
},
|
|
{
|
|
"name": "Beeper Matrix",
|
|
"slug": "matrix",
|
|
"type": "platform",
|
|
"community": true,
|
|
"description": "Matrix adapter for Chat SDK, built and maintained by Beeper.",
|
|
"packageName": "@beeper/chat-adapter-matrix",
|
|
"author": "Beeper",
|
|
"readme": "https://github.com/beeper/chat-adapter-matrix/tree/632fb141b07d7243f2a09ee12ec55854c628217d",
|
|
"vendorOfficial": true
|
|
},
|
|
{
|
|
"name": "Webex",
|
|
"slug": "webex",
|
|
"type": "platform",
|
|
"community": true,
|
|
"description": "Community Webex adapter for Chat SDK with support for spaces, threads, and adaptive cards.",
|
|
"packageName": "@bitbasti/chat-adapter-webex",
|
|
"author": "SebastianBodza",
|
|
"readme": "https://github.com/SebastianBodza/chat-adapter-webex/tree/982d76b24217dfe2e248ec13a17d16c2df32e09e"
|
|
},
|
|
{
|
|
"name": "Baileys WhatsApp",
|
|
"slug": "baileys",
|
|
"type": "platform",
|
|
"community": true,
|
|
"description": "Chat SDK adapter for Baileys (Unofficial WhatsApp API).",
|
|
"packageName": "chat-adapter-baileys",
|
|
"author": "rama-adi",
|
|
"readme": "https://github.com/rama-adi/chat-adapter-baileys/tree/b5454e7c04c75d91b06213f16a4af82ddb4a120f"
|
|
},
|
|
{
|
|
"name": "Zaileys WhatsApp",
|
|
"slug": "zaileys",
|
|
"type": "platform",
|
|
"community": true,
|
|
"description": "WhatsApp adapter powered by Zaileys \u2014 real message history, native buttons from Cards, decrypted poll votes, and scheduling.",
|
|
"packageName": "chat-adapter-zaileys",
|
|
"author": "zeative",
|
|
"readme": "https://github.com/zeative/chat-adapter-zaileys"
|
|
},
|
|
{
|
|
"name": "Blooio iMessage",
|
|
"slug": "blooio",
|
|
"type": "platform",
|
|
"community": true,
|
|
"description": "Blooio adapter for Chat SDK to send and receive iMessage, RCS, and SMS from your bot.",
|
|
"packageName": "chat-adapter-blooio",
|
|
"author": "midday-ai",
|
|
"readme": "https://github.com/midday-ai/chat-adapter-blooio/tree/283678e3490275c7b440221ce3cdeac56bbfb60a"
|
|
},
|
|
{
|
|
"name": "Zalo",
|
|
"slug": "zalo",
|
|
"type": "platform",
|
|
"community": true,
|
|
"description": "Zalo adapter for Chat SDK using Zalo for building your own Zalo bots.",
|
|
"packageName": "chat-adapter-zalo",
|
|
"author": "buiducnhat",
|
|
"readme": "https://github.com/buiducnhat/chat-adapter-zalo/tree/a11acb91efa9752c6d15c0a00c759b92c479e6fa"
|
|
},
|
|
{
|
|
"name": "Mattermost",
|
|
"slug": "mattermost",
|
|
"type": "platform",
|
|
"community": true,
|
|
"description": "Mattermost adapter for Chat SDK with support for posts, reactions, and slash commands.",
|
|
"packageName": "chat-adapter-mattermost",
|
|
"author": "thiagoferolla",
|
|
"readme": "https://github.com/thiagoferolla/chat-adapter-mattermost/tree/70eb85321cba65d511f6e158b9a2f5aac2aa922c"
|
|
},
|
|
{
|
|
"name": "AgentPhone",
|
|
"slug": "agentphone",
|
|
"type": "platform",
|
|
"community": true,
|
|
"description": "Unified SMS, MMS, iMessage, and voice adapter for Chat SDK with HMAC-verified webhooks, iMessage reactions, and voice call transcripts via AgentPhone.",
|
|
"packageName": "@agentphone/chat-sdk-adapter",
|
|
"author": "AgentPhone",
|
|
"readme": "https://github.com/AgentPhone-AI/chat-sdk-adapter",
|
|
"vendorOfficial": true
|
|
},
|
|
{
|
|
"name": "Lark / Feishu",
|
|
"slug": "lark",
|
|
"type": "platform",
|
|
"community": true,
|
|
"description": "Lark / Feishu adapter for Chat SDK with native cardkit streaming, interactive cards, and reactions.",
|
|
"packageName": "@larksuite/vercel-chat-adapter",
|
|
"author": "Lark / Feishu",
|
|
"readme": "https://github.com/larksuite/node-sdk/tree/cbc4adf13cbcb93b389db01faf428e3b3cef053c/docs/vercel-chat-adapter",
|
|
"vendorOfficial": true
|
|
},
|
|
{
|
|
"name": "Velt",
|
|
"slug": "velt",
|
|
"type": "platform",
|
|
"community": true,
|
|
"description": "Velt Comments adapter for bots that read, reply, mention, and start threads in anchored comments across documents, rich-text editors, canvases, PDFs, and video. Includes per-comment document context and an AI streaming-reply sample app.",
|
|
"packageName": "@veltdev/chat-sdk-adapter",
|
|
"author": "Velt",
|
|
"readme": "https://github.com/velt-js/velt-chat-sdk-adapter/tree/9974db6ee24dc378987decc5c56cce95a12e7805/packages/chat-sdk-adapter",
|
|
"vendorOfficial": true
|
|
},
|
|
{
|
|
"name": "Kapso",
|
|
"slug": "kapso",
|
|
"type": "platform",
|
|
"community": true,
|
|
"description": "Kapso-first WhatsApp adapter for Chat SDK with signed Kapso webhooks, WhatsApp replies, buttons, media, reactions, and conversation history.",
|
|
"packageName": "@kapso/chat-adapter",
|
|
"author": "Kapso",
|
|
"readme": "https://github.com/gokapso/chat-sdk-adapter/tree/7c7e9b349323b8cfa060cc64b15d97bcb9f906b3",
|
|
"vendorOfficial": true
|
|
},
|
|
{
|
|
"name": "Novu",
|
|
"slug": "novu",
|
|
"type": "platform",
|
|
"community": true,
|
|
"description": "Multi-channel agents with one-click channel setup, identity and multi-tenancy",
|
|
"packageName": "@novu/chat-sdk-adapter",
|
|
"author": "Novu",
|
|
"readme": "https://github.com/novuhq/novu/blob/24d8855c294bcf27450c91d2e2a0f9db9ffb8f73/packages/chat-adapter",
|
|
"vendorOfficial": true
|
|
},
|
|
{
|
|
"name": "Linq",
|
|
"slug": "linq",
|
|
"type": "platform",
|
|
"community": true,
|
|
"description": "iMessage and SMS adapter for Chat SDK, built and maintained by Linq.",
|
|
"packageName": "@linqapp/chat-sdk-adapter",
|
|
"author": "Linq",
|
|
"readme": "https://github.com/linq-team/linq-chat-sdk/tree/main/packages/adapter-linq",
|
|
"vendorOfficial": true
|
|
},
|
|
{
|
|
"name": "Photon",
|
|
"slug": "photon",
|
|
"type": "platform",
|
|
"community": true,
|
|
"description": "iMessage adapter for Chat SDK, built and maintained by Photon. Cloud, self-hosted, and on-device (macOS) iMessage over spectrum-ts.",
|
|
"packageName": "@photon-ai/chat-adapter-imessage",
|
|
"author": "Photon",
|
|
"readme": "https://github.com/photon-hq/vercel-chat-adapter-imessage",
|
|
"vendorOfficial": true
|
|
},
|
|
{
|
|
"name": "Dial",
|
|
"slug": "dial",
|
|
"type": "platform",
|
|
"community": true,
|
|
"description": "SMS, MMS, iMessage, and inbound voice-call transcripts for Chat SDK, built and maintained by Dial. One handler answers phone traffic the same way it answers Slack/Teams/Discord, with HMAC-signed webhooks and replies over @getdial/sdk.",
|
|
"packageName": "@getdial/chat-sdk-adapter",
|
|
"author": "Dial",
|
|
"readme": "https://github.com/GetDial-AI/chat-sdk-adapter",
|
|
"vendorOfficial": true
|
|
},
|
|
{
|
|
"name": "Weixin",
|
|
"slug": "weixin",
|
|
"type": "platform",
|
|
"community": true,
|
|
"description": "Community Weixin (WeChat) iLink bot adapter for Chat SDK with long polling, QR login, media uploads, and typing indicators.",
|
|
"packageName": "chat-adapter-weixin",
|
|
"author": "wong2",
|
|
"readme": "https://github.com/wong2/weixin-chat-adapter"
|
|
}
|
|
]
|