fbmessenger-express-bot
v1.0.1
Published
NodeJS Express middleware that sets up a Facebook Messenger chatbot endpoint.
Downloads
2
Maintainers
Readme
fbmessenger-express-bot
NodeJS Express middleware that sets up a POST endpoint for the Facebook Messenger platform.
Getting started
Register the middleware for Express and provide a function to handle incoming messages
var express = require('express');
var botHelper = require('fbmessenger-express-bot');
var app = express();
app.use(botHelper({
pageAccessToken: 'your_token_here', // Facebook page access token, set in Facebook App Dashboard
route: '/webhook', // Webhook endpoint path for incoming messages
handle: myFunction // The function that will be called when a message comes in
}));
Configuration
handle
: The callback function for incoming messages.pageAccessToken
: Facebook App's page access token, configured in App Dashboard 'Messenger' settings (https://developers.facebook.com/apps)route
: Sets the webhook path (/webhook
by default)