
Security News
pnpm 10.12 Introduces Global Virtual Store and Expanded Version Catalogs
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.
SDK wrapper to verifyRequest, send message, recieve with Facebook Messenger Bots.
SDK wrapper to verifyRequest, send message, recieve with Facebook Messenger Bots.
$ npm install --save fb-bot
This link initializing module parameters.
var express = require('express');
var facebookModule = require('fb-bot.js');
var app = express();
facebookModule.init({
APP_SECRET: 'YOUR_APP_SECRET',
VALIDATION_TOKEN: 'YOUR_VALIDATION_TOKEN',
PAGE_ACCESS_TOKEN: 'YOUR_PAGE_ACCESS_TOKEN',
SERVER_URL: 'YOUR_SERVER_UR'
});
app.use(bodyParser.json({ verify: facebookModule.verifyRequestSignature }));
### 2 important funtions
facebookModule.sendTextMessage(_senderId, _message).then( ... )
facebookModule.messageListener(data, callback)
//Facebook message
app.post('/webhook', facebookModule.parsePOST, function (req, res) {
var dataList = req.afterParse ;
dataList.forEach(function(data){
facebookModule.messageListener(data, function(){
facebookModule.sendTextMessage(data.senderId, data.message.text);
});
});
res.sendStatus(200);
});
//Facebook message
app.post('/webhook', facebookModule.parsePOST, function (req, res) {
var dataList = req.afterParse ;
dataList.forEach(function(data){
facebookModule.messageListener(data, function(){
facebookModule.sendTextMessage(data.senderId, data.message.attachments[0].payload.url);
});
});
res.sendStatus(200);
});
## Verification
app.get('/webhook', facebookModule.authGET, function (req, res, next) {
res.status(200).send(req.query['hub.challenge']);
});
## Recieve Message
app.post('/webhook', facebookModule.parsePOST, function (req, res) {
var dataList = req.afterParse ;
dataList.forEach(function(data){
// ....
});
res.sendStatus(200);
});
FAQs
SDK wrapper to verifyRequest, send message, recieve with Facebook Messenger Bots.
The npm package fb-bot receives a total of 0 weekly downloads. As such, fb-bot popularity was classified as not popular.
We found that fb-bot demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.
Security News
Amaro 1.0 lays the groundwork for stable TypeScript support in Node.js, bringing official .ts loading closer to reality.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.