This app is a basic demo of using the Messenger Platform's handover protocol.
To run this app you will need the following:
- Facebook developer account
- Facebook developer app with a configured webhook
- Facebook Page
- A server that has Node.js installed
This repo contains code for the webhook and application logic for an example Messenger bot. To run it, do the following:
- Download this repo
- Deploy the repo to your server
- Create an
env
file with the followingmodule.exports
object:
module.exports = {
"PAGE_ACCESS_TOKEN": "<YOUR PAGE ACCESS TOKEN>",
"VERIFY_TOKEN": "YOUR WEBHOOK VERIFY TOKEN"
}
Alternatively, you can set the above as environment variables.
- Run
npm install
in the repo directory - Run
node index.js
to start the webhook - Configure the webhook in your Facebook app settings
- Subscribe the Facebook app to receive webhook events for your Page
- Send any text message to the bot. The bot will respond with a greeting message and 'Pass to Inbox' quick reply.
- Check the 'Done' checkbox to pass control back to the bot.