FB Messenger Adapter

This document explains how to use the Facebook Messenger Adapter module to connect a bot to Facebook Messenger.


This module contains a Web Adapter, a subclass of Adapter, which lets the bot communicate with messaging platforms. You can see how adapters works here.


Follow the following steps to use the MessengerAdapter module in your bot.

First of all, you need to install the module.

npm install --save botfuel-module-adapter-messenger

Specify the module in the bot configuration file.

module.exports = {
  adapter: {
    name: 'messenger',
  modules: ['botfuel-module-adapter-messenger'],

To use this adapter, the Facebook Verify Token should be set in process.env.FB_VERIFY_TOKEN and the Facebook Page Access Token should be set in process.env.FB_PAGE_ACCESS_TOKEN.

Message types supported

The messenger adapter supports the following types of messages:

  • ActionsMessage
  • BotImageMessage
  • BotTextMessage
  • CardsMessage
  • PostbackMessage
  • QuickRepliesMessage
  • UserTextMessage
  • UserImageMessage
  • UserFileMessage

By default, UserImageMessage and UserFileMessage will trigger a dialog warning the user that uploads are not supported. If you want to handle this kind of message yourself, add respectively 'image-dialog', 'image-view' and 'file-dialog', 'file-view' files in your own bot. See Dialogs and Views for more information.

The messenger adapter currently supports events of type messages and messaging_postbacks. Please, make sure that the bot is not subscribed to message_echoes in Facebook webhook events.

See Module Overview for more information on how to create and use a module.