An open API service indexing awesome lists of open source software.

https://github.com/js-kyle/firebase-webhook

Sends WebHooks based on realtime database updates
https://github.com/js-kyle/firebase-webhook

firebase real-time webhooks

Last synced: 3 months ago
JSON representation

Sends WebHooks based on realtime database updates

Awesome Lists containing this project

README

          

# firebase-webhook
[![npm version](https://badge.fury.io/js/firebase-webhook.svg)](https://badge.fury.io/js/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:

```sh
$ npm install --save firebase-webhook
```
### Usage

Import the module:
```javascript
const fbwebhook = require('firebase-webhook');
```
Authenicate your app with Firebase using Firebase Admin Node.js SDK

Create a subscription:

```javascript
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.

``` javascript
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

[//]: # (These are reference links used in the body of this note and get stripped out when the markdown processor does its job. There is no need to format nicely because it shouldn't be seen. Thanks SO - http://stackoverflow.com/questions/4823468/store-comments-in-markdown-syntax)

[dill]:
[git-repo-url]:
[john gruber]:
[df1]:
[markdown-it]:
[Ace Editor]:
[node.js]:
[Twitter Bootstrap]:
[jQuery]:
[@tjholowaychuk]:
[express]:
[AngularJS]:
[Gulp]:

[PlDb]:
[PlGh]:
[PlGd]:
[PlOd]:
[PlMe]:
[PlGa]: