Facebook Messenger App

Messenger App make it easy to start conversations with your pages.To get in touch, people simply scanning below image using the Messenger app.

Digital Devnet Messenger@digitaldevnet
Click below link to launch messenger in your browser.

Facebook Messenger Setup
Messenger bots uses a web server to process messages it receives or to figure out what messages to send. You also need to have the bot be authenticated to speak with the web server and the bot approved by Facebook to speak with the public.

Get started with Facebook guide

Download the sample app from Github to follow along with this tutorial.


  1. Create a Facebook App and Page
  2. Setup Webhook in Facebook
  3. Setup Heroku via node Js

Using Heroku
$ heroku login
$ git init
$ heroku git:remote -a <YourHerokuAppName>
$ heroku buildpacks:set heroku/nodejs

Install NPM and dependencies as per download app
$ npm install express body-parser request –save

Create a Procfile to invoke to start your Bot.
web: node app.js

Creative .ENV file + Heroku Config Vars
PAGE_ACCESS_TOKEN: “Facebook Page Token”
appSecret:         “ App Secret Key”
pageAccessToken: “Facebook Page Token”
serverURL:         “ Bot Public URL “
validationToken:   “ Webhook Key”

Run locally using NPM
$ npm start
Node app is running on port 5000

Important Notes.
For deployment, it need a cloud server or some shared hosting to deploy your bot.

Callback URL – The Heroku Webhook does not require addon during heroku setup.

You need to subscribe your custom webhook to the Page events by issuing a POST request and providing PAGE_ACCESS_TOKEN. The simplest way to do it is to use “curl” it.
heroku config:add PAGE_ACCESS_TOKEN=$your_page_token_here
heroku config:add VERIFY_TOKEN=$your_verification_token_here


Leave a Comment

Your email address will not be published. Required fields are marked *