firebase-webhook provides the ability to send WebHooks based on updates to a specified path in a Firebase Realtime Database.
This module is installed via NPM:
$ npm install --save firebase-webhook
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);
Listen for updates to a specific path in Firebase.
fbwebhook.subscribe(path : String, options: Object);
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.
- Test coverage
MIT