messenger-page-access-token
v1.0.4
Published
🗝 Have the receiving page's access_token handy
Downloads
9
Maintainers
Readme
messenger-page-access-token
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 |