Skip to content

Botkit Middleware to populate a Botkit message with Facebook Messenger user info

Notifications You must be signed in to change notification settings

mrbot-ai/botkit-middleware-fbuser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Botkit Middleware to populate Facebook Messenger user info to a Botkit message

Installation

Add github repo url to package.json

Example:

var fbuser = require('botkit-middleware-fbuser')({
    accessToken:'<fb_access_token>',
    fields: ['first_name', 'last_name', 'locale', 'profile_pic','timezone','gender','is_payment_enabled'],
    logLevel:'error',
    expire: 24 * 60 * 60 * 1000, // refresh profile info every 24 hours
    storage: '<Botkit storage object>'
});


controller.middleware.receive.use(fbuser.receive)

A message object will have an additional field user_profile with the fields requested to Facebook API.

##Author

Nathan Zylbersztejn

Github: @znat

About

Botkit Middleware to populate a Botkit message with Facebook Messenger user info

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published