Files
vercel__chat/apps/docs/adapters.json
Vishal Yathish 68025ca965 [messenger] add messenger (meta) platform adapter to chat sdk (#461)
* [messenger] add messenger (meta) platform adapter to chat sdk

- Webhook handling with HMAC-SHA256 signature verification
- Generic and Button template support for cards
- Postback, reaction, delivery/read confirmation handling
- Message caching for fetchMessages (Messenger has no history API)
- Replay tests and ~98% code coverage

Co-authored-by: Dimitar K. Nikolov <mitkodkn@users.noreply.github.com>
Co-authored-by: Ben Sabic <27636870+bensabic@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

* Fix: The `@chat-adapter/messenger` package version is `4.15.0` while all other packages in the Changesets fixed version group are at `4.27.0`, breaking the fixed versioning contract.

This commit fixes the issue reported at packages/adapter-messenger/package.json:3

**Bug explanation:**

The repository uses Changesets with a `"fixed"` configuration: `[["chat", "@chat-adapter/*"]]`. This means all packages matching these patterns must always share the same version number. Every package in the group (`chat`, `@chat-adapter/discord`, `@chat-adapter/gchat`, `@chat-adapter/github`, `@chat-adapter/linear`, `@chat-adapter/shared`, `@chat-adapter/slack`, `@chat-adapter/teams`, `@chat-adapter/telegram`, `@chat-adapter/web`, `@chat-adapter/whatsapp`, and the state packages) is at version `4.27.0`, except `@chat-adapter/messenger` which is at `4.15.0`.

This is likely because the messenger adapter was newly added to the monorepo (copied from a template or created fresh) and its version was never aligned with the rest of the fixed group. This mismatch will cause problems with the Changesets release workflow — when Changesets tries to bump versions for the fixed group, it may produce inconsistent or errored releases because one package is 12 minor versions behind the others.

**Fix explanation:**

Changed `"version": "4.15.0"` to `"version": "4.27.0"` in `packages/adapter-messenger/package.json` to align it with all other packages in the fixed version group.

Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: visyat <vishal.yathish@gmail.com>

* Fix: Messenger adapter env var guard only checks `FACEBOOK_APP_SECRET` but `createMessengerAdapter` requires all three env vars, causing a `ValidationError` crash at Next.js build time when only `FACEBOOK_APP_SECRET` is set.

This commit fixes the issue reported at examples/nextjs-chat/src/lib/adapters.ts:154

**Bug Analysis:**

The build failure is confirmed in the Vercel build log with:
```
Error [ValidationError]: pageAccessToken is required. Set FACEBOOK_PAGE_ACCESS_TOKEN or provide it in config.
```

The root cause is in `examples/nextjs-chat/src/lib/adapters.ts` at line ~154. The messenger adapter guard only checks for `FACEBOOK_APP_SECRET`:
```typescript
if (process.env.FACEBOOK_APP_SECRET) {
```

However, `createMessengerAdapter` (in `packages/adapter-messenger/src/index.ts`) validates and throws `ValidationError` for each of three required env vars: `FACEBOOK_APP_SECRET`, `FACEBOOK_PAGE_ACCESS_TOKEN`, and `FACEBOOK_VERIFY_TOKEN`. When only `FACEBOOK_APP_SECRET` is set in the Vercel project environment, the guard passes, `createMessengerAdapter` is called, and it throws a `ValidationError` for the missing `FACEBOOK_PAGE_ACCESS_TOKEN`. Since this code runs at module evaluation time during the Next.js build's "Collecting page data" phase, the uncaught error crashes the entire build.

This is inconsistent with other adapters in the same file. For example, the WhatsApp adapter checks both `WHATSAPP_ACCESS_TOKEN` and `WHATSAPP_PHONE_NUMBER_ID`, and the gchat/github/linear/whatsapp adapters all wrap creation in try-catch blocks.

**Fix:**

1. Updated the env var guard to check all three required environment variables (`FACEBOOK_APP_SECRET`, `FACEBOOK_PAGE_ACCESS_TOKEN`, and `FACEBOOK_VERIFY_TOKEN`) before attempting to create the adapter.
2. Wrapped the `createMessengerAdapter` call in a try-catch block (matching the pattern used by gchat, github, linear, and whatsapp adapters) so that any unexpected validation errors are caught and logged as warnings instead of crashing the build.

Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: visyat <vishal.yathish@gmail.com>

---------

Co-authored-by: Dimitar K. Nikolov <mitkodkn@users.noreply.github.com>
Co-authored-by: Ben Sabic <27636870+bensabic@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
2026-05-08 17:25:54 +10:00

278 lines
10 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": "google-chat",
"type": "platform",
"description": "Integrate with Google Chat spaces for team collaboration and automated workflows.",
"packageName": "@chat-adapter/gchat",
"icon": "google-chat",
"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": "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 — 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": "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": "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": "Photon iMessage",
"slug": "imessage",
"type": "platform",
"community": true,
"description": "iMessage adapter for Chat SDK. Supports both local (on-device) and Photon iMessage integration.",
"packageName": "chat-adapter-imessage",
"author": "Photon",
"readme": "https://github.com/photon-hq/vercel-chat-adapter-imessage/tree/8e6ae8f1b824db798664c98be91138f083e02262",
"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": "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": "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": "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": "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": "Sendblue iMessage",
"slug": "sendblue",
"type": "platform",
"community": true,
"description": "iMessage adapter for Chat SDK using Sendblue for building your own iMessage bots.",
"packageName": "chat-adapter-sendblue",
"author": "midday-ai",
"readme": "https://github.com/midday-ai/chat-adapter-sendblue/tree/5125a9d018f5d05dca063cd4d7e554fdb92ecce8"
},
{
"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"
}
]