messenger-page-access-token

1.0.4 • Public • Published

messenger-page-access-token

build status code coverage code style styled with prettier made with lass license

Have the receiving page's access_token handy

Table of Contents

Install

npm:

npm install messenger-page-access-token

yarn:

yarn add messenger-page-access-token

Usage

const messenger = require('messenger-core')
const loadPlugins = require('plugin-powered')
const pluginOptions = {
  prefix: 'messenger-'
}
 
loadPlugins(messenger, {
  'page-access-token': '<<YOUR_PAGE_ACCESS_TOKEN>>'
}, pluginOptions)
 
// if your bot handles multiple pages
loadPlugins(messenger, {
  'messenger-page-access-token': {
    '<<PAGE_ID>>'         : '<<YOUR_PAGE_ACCESS_TOKEN>>',
    '<<ANOTHER_PAGE_ID>>' : '<<ANOTHER_PAGE_ACCESS_TOKEN>>'
    // etc.
  }, pluginOptions
})
 
// if you have your page access token store in an environment variable
loadPlugins(messenger, {
  'page-access-token': 'MY_ENVIRONMENT_VARIABLE'
}, pluginOptions)
 
// use the `MESSENGER_PAGE_ACCESS_TOKEN` environment variable
loadPlugins(messenger, {
  'page-access-token': true
}, pluginOptions)
 

Contributors

Name Website
Andreas Pizsa https://github.com/AndreasPizsa

License

MIT © Andreas Pizsa

Package Sidebar

Install

npm i messenger-page-access-token

Weekly Downloads

1

Version

1.0.4

License

MIT

Last publish

Collaborators

  • andreaspizsa