Skip to content
Sends WebHooks based on realtime database updates
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist
.babelrc
README.md
main.js
package.json
webhook.js

README.md

firebase-webhook

npm version

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-webhook

Usage

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

You can’t perform that action at this time.