firebase-webhook
firebase-webhook provides the ability to send WebHooks based on updates to a specified path in a Firebase Realtime Database.
Installation
This module is installed via NPM:
$ npm install --save firebase-webhookUsage
Import the module:
const fbwebhook = require('firebase-webhook');Authenicate your app with Firebase using Firebase Admin Node.js SDK
Create a subscription:
const webhookOpts = {
endpoint: 'https://requestb.in/abcdef',
headers: {"X-Hello" : "World"},
data: ['name', 'email']
}
fbwebhook.subscribe('users/', webhookOpts);API
Subscribe
Listen for updates to a specific path in Firebase.
fbwebhook.subscribe(path : String, options: Object);Options
endpoint {String}
The webhook endpoint for this subscription.
headers {Object}
Key value pairs of custom http headers for the WebHook POST.
data {Array}
Specify which nodes of the updated child will be sent with the WebHook payload.
Todos
- Test coverage
License
MIT