Skip to content

messengerjs/messenger-page-access-token

Repository files navigation

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

About

🗝 Have the receiving page's access_token handy

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published