1.0.1 • Published 8 years ago

fbmessenger-express-bot v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

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)

License

MIT License