Skip to content

js-kyle/firebase-webhook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Sends WebHooks based on realtime database updates

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published