fb-messenger-bot-express

0.0.3 • Public • Published

fb-messenger-bot-express

fb-messenger-bot-express is a node.js package for providing a Connect/Express middleware that can be used to provide the required endpoints for facebook messenger bot platform.

Installation (via npm)

$ npm install fb-messenger-bot-express

Usage

Simple Usage

var express = require('express')
  , fbb = require('fb-messenger-bot-express')
  , app = express();
 
app.use(fbb());

Set your incoming message callback function

var express = require('express')
  , fbb = require('fb-messenger-bot-express')
  , app = express();
 
app.use(fbb({
  incoming: function(req, res) {
      // handle incoming messages
  }
}));

Configuration Options

  • validationCode: Configures the validation code for your webhook.

  • route: Configures the webhook path

  • incoming: Callback function for incoming messages from facebook messenger.

The default configuration is the equivalent of:

{
  "validationCode": "fbvalidation",
  "route": "/messenger",
  "incoming": function(req, res) {}
}

License

MIT License

Author

Patrick Zimmermann (patrick@knowhere.to)

knowhere GmbH (https://knowhere-media.de, https://github.com/knowhereto)

Package Sidebar

Install

npm i fb-messenger-bot-express

Weekly Downloads

6

Version

0.0.3

License

MIT

Last publish

Collaborators

  • pz101