@chat-adapter/messenger weekly downloads statistics
By chat-adapter (14 listings) · npm · AI SDKs
Facebook Messenger adapter for Chat SDK — Send API webhooks, templates, and postbacks
@chat-adapter/messenger has 49,903 recorded weekly downloads on npm, an increase of 76.7% over the past 30 days, ranking #785 of 3,247 tracked listings.
About @chat-adapter/messenger
@chat-adapter/messenger
npm package:
@chat-adapter/messenger
Facebook Messenger adapter for Chat SDK, using the Messenger Platform API.
Documentation: chat-sdk.dev/adapters/official/messenger · Guides: vercel.com/kb/chat-sdk
Building for Instagram Direct Messages? Use
@chat-adapter/instagraminstead. It connects through Instagram API with Instagram Login and does not require a Facebook Page.
Installation
pnpm add @chat-adapter/messenger @chat-adapter/state-memory
Scaffold with the CLI
To scaffold a new Messenger bot with this adapter preselected:
npx create-chat-sdk@latest my-bot --adapter messenger memory
Visit the adapters directory to see other available official and vendor-official adapters.
Usage
import { Chat } from "chat";
import { createMessengerAdapter } from "@chat-adapter/messenger";
import { createMemoryState } from "@chat-adapter/state-memory";
const bot = new Chat({
userName: "mybot",
adapters: {
messenger: createMessengerAdapter(),
},
state: createMemoryState(),
});
bot.onDirectMessage(async (thread, message) => {
await thread.post("Hello from Messenger!");
});
When using createMessengerAdapter() without arguments, credentials are auto-detected from environment variables.
The memory state adapter keeps subscriptions and locks in process memory, which suits local development. Use a Redis or PostgreSQL state adapter in production.
Facebook Messenger setup
1. Create a Meta app
- Go to developers.facebook.com/apps
- Click Create App
- Select the use case "Engage with customers on Messenger from Meta"
- Enter your app name and contact email, then create the app
- Go to App > App Settings > Basic and copy your App Secret — this becomes
FACEBOOK_APP_SECRET
2. Create a Facebook Page
Your Messenger bot needs a Facebook Page to send and receive messages. If you don't have one:
- The easiest approach is to create a Facebook Business profile first
- Then create a Page under that business profile
- Note the Page name — users will message this Page to interact with your bot
3. Configure Messenger API
- In your Meta app dashboard, go to Use Cases
- Find "Engage with customers on Messenger from Meta" and click Customize
- Then open Messenger API Settings
Configure webhooks
- Under Configure webhooks, click Add Callback URL
- Enter your webhook URL:
https://your-domain.com/api/webhooks/messenger - Enter a Verify Token — this is a secret string you create (this becomes
FACEBOOK_VERIFY_TOKEN) - Click Verify and Save
- After verification, click Add Subscriptions and enable:
messagesmessaging_postbacksmessaging_reactionsmessage_deliveriesmessage_reads
Generate a Page Access Token
- Under Generate access tokens, click Add or remove Pages
- Your Pages should populate — select the Page you created
- Assign the standard permissions when prompted
- Click Generate Token
- Copy the token — this becomes
FACEBOOK_PAGE_ACCESS_TOKEN
Configuration
You can call createMessengerAdapter() with no arguments when the environment variables are set.
| Option | Required | Description |
|---|---|---|
appSecret | No* | App secret for webhook signature verification. Auto-detected from FACEBOOK_APP_SECRET |
pageAccessToken | No* | Page access token. Auto-detected from FACEBOOK_PAGE_ACCESS_TOKEN |
verifyToken | No* | Webhook verify token. Auto-detected from FACEBOOK_VERIFY_TOKEN |
apiVersion | No | Graph API version (defaults to v21.0) |
userName | No | Bot username. Defaults to the Page name, or to the userName passed to Chat when the Page lookup fails |
logger | No | Logger instance (defaults to ConsoleLogger("info")) |
*Required at runtime, either in config or as an environment variable.
Environment variables
FACEBOOK_APP_SECRET=... # App secret from App Settings > Basic
FACEBOOK_PAGE_ACCESS_TOKEN=... # Generated Page access token
FACEBOOK_VERIFY_TOKEN=... # Webhook verify token that you choose
All three are required unless you pass the matching option to createMessengerAdapter().
Webhook setup
Messenger uses two webhook mechanisms:
- Verification handshake (GET). Meta sends
hub.mode=subscribeand ahub.verify_tokenthat must match yourFACEBOOK_VERIFY_TOKEN. A mismatch gets a 403 response. - Event delivery (POST). Incoming messages, reactions, and postbacks are verified with the
X-Hub-Signature-256header. A missing or wrong signature gets a 403 response.
// Next.js App Router example
import { after } from "next/server";
import { bot } from "@/lib/bot";
export async function GET(request: Request) {
return bot.webhooks.messenger(request);
}
export async function POST(request: Request) {
return bot.webhooks.messenger(request, {
waitUntil: (task) => after(() => task),
});
}
```…
Description from the npm listing.
- chat
- chat-sdk
- chatbot
- messenger
- facebook-messenger
- meta
- bot
- adapter
- messaging
- ai-agent
- ai-sdk
- vercel
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (170)Similar npm AI SDKs plugins
All 20 @chat-adapter/messenger alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/@chat-adapter/messenger. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.