npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@builderbot/provider-facebook-messenger

v1.4.1

Published

Provider for Facebook Messenger

Downloads

1,031

Readme

Facebook Messenger Provider

This provider allows you to connect your BuilderBot chatbot with Facebook Messenger.

Installation

npm install @builderbot/provider-facebook-messenger

Configuration

Before using this provider, you need to:

  1. Create a Facebook App at Facebook Developers
  2. Add the Messenger product to your app
  3. Create or select a Facebook Page
  4. Generate a Page Access Token
  5. Set up a webhook with your verify token

Usage

import { createBot, createProvider, createFlow } from '@builderbot/bot'
import { FacebookMessengerProvider } from '@builderbot/provider-facebook-messenger'

const main = async () => {
    const provider = createProvider(FacebookMessengerProvider, {
        accessToken: 'YOUR_PAGE_ACCESS_TOKEN',
        pageId: 'YOUR_PAGE_ID',
        verifyToken: 'YOUR_VERIFY_TOKEN',
        version: 'v19.0', // optional, defaults to v19.0
        port: 3000, // optional, defaults to 3000
    })

    await createBot({
        flow: createFlow([]),
        provider,
        database: // your database adapter
    })
}

main()

Configuration Options

| Option | Type | Required | Default | Description | |--------|------|----------|---------|-------------| | accessToken | string | Yes | - | Your Facebook Page Access Token | | pageId | string | Yes | - | Your Facebook Page ID | | verifyToken | string | Yes | - | The verify token you set in Facebook webhook settings | | version | string | No | v19.0 | Facebook Graph API version | | port | number | No | 3000 | Port for the webhook server | | name | string | No | facebook-messenger-bot | Name identifier for the bot |

Webhook Setup

  1. In your Facebook App dashboard, go to Messenger > Settings
  2. Add a webhook URL: https://your-domain.com/webhook
  3. Enter your verify token
  4. Subscribe to the following events:
    • messages
    • messaging_postbacks
    • messaging_optins

Available Methods

sendMessage(userId, message, options?)

Send a text message to a user.

sendImage(userId, imageUrl)

Send an image attachment.

sendVideo(userId, videoUrl)

Send a video attachment.

sendAudio(userId, audioUrl)

Send an audio attachment.

sendFile(userId, fileUrl)

Send a file attachment.

sendButtons(userId, text, buttons)

Send a button template.

await provider.sendButtons('user_id', 'Choose an option:', [
    { type: 'postback', title: 'Option 1', payload: 'OPTION_1' },
    { type: 'web_url', title: 'Visit Website', url: 'https://example.com' }
])

sendQuickReplies(userId, text, quickReplies)

Send quick reply buttons.

await provider.sendQuickReplies('user_id', 'Quick options:', [
    { content_type: 'text', title: 'Yes', payload: 'YES' },
    { content_type: 'text', title: 'No', payload: 'NO' }
])

saveFile(ctx, options?)

Save a file from a received message.

Supported Events

The provider handles the following incoming events:

  • Text messages: Regular text messages from users
  • Image attachments: Images sent by users
  • Video attachments: Videos sent by users
  • Audio attachments: Audio files and voice notes
  • File attachments: Documents and other files
  • Location sharing: Location data from users
  • Postback events: Button click responses

Documentation

Visit builderbot.app to view the full documentation.

Official Course

If you want to discover all the functions and features offered by the library you can take the course. View Course

Contact Us