New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

calamarble-fb-webhook-verify

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

calamarble-fb-webhook-verify

Function to handle Facebook Messenger Platform webhooks token verification

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Facebook Messenger Token Verification

A function to handle token verifications of the Facebook Messenger Platform format.

Usage

With express.js

import express from 'express';
import { apiEndpoint } from 'calamarble-fb-webhook-verify';

const expressConfig = {
    port: 8088,
    getPath: '/fbwebhook',
    messages: {
        serverRunning: (port) => `Server running on port ${port}`
    }
}
const fbVerifyConfig = {
    verifyToken: 'YOUR_VERIFY_TOKEN',
    messages: {
        validationFailed: 'Failed validation.'
    }
}
const config = Object.assign({}, expressConfig, fbVerifyConfig);
const app = express();
const getEndPoint = apiEndpoint(config);
app.get(config.getPath, getEndPoint);
app.listen(config.port, () => console.log(`Server running on port ${config.port}`));

With claudia-api-builder

import ApiBuilder from 'claudia-api-builder';
import { apiEndpoint as fbWebhookGet} from 'calamarble-fb-webhook-verify';

const api = new ApiBuilder();
const config = {
    verifyToken: 'YOUR_VERIFY_TOKEN',
    messages: {
        validationFailed: 'Failed validation.'
    }
}

api.get('/fbwebhook', fbWebhookGet(config));

export { api as default };

With AWS Lambda and the "Method Request passthrough" template of API Gateway

import { handler as handlerConstructor } from './path/to/calamarble-fb-webhook-verify/index';

const config = {
    verifyToken: 'YOUR_VERIFY_TOKEN',
    messages: {
        validationFailed: 'Failed validation.'
    }
}
const handler = handlerConstructor(config);
export { handler };

See CONTRIBUTING.md for screenshots of the API Gateway setup on AWS

Keywords

FAQs

Package last updated on 08 Aug 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc