You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Nicolas Garnier d15f5285eb Fixes #38 8 years ago
..
functions Fixes #38 8 years ago
README.md Updating version of the firebase-functions module in package.json files to launch version 8 years ago

README.md

Webhook upon Database writes

This Function shows how a Database write can trigger a request to a hardcoded callback URL (a Webhook). The content of the modified Data is sent to the Webhook.

Functions Code

See file functions/index.js for the code.

We're sending a request to an external webhook. As a sample we're using a Request Bin from requestb.in that will receive the Data so you can visualize it easily. make sure you create your own Request Bin and update the sample with it.

Note: You will need to enable billing on your Firebase the project by switching to the Blaze plan, this is currently needed to be able to perform HTTP requests to external services from a Cloud Function.

Sample Database Structure

As an example we'll be using a database structure where adding or updating an element under /hooks will trigger the Webhook:

/functions-project-12345
    /hooks
        /key-123456
            stuff: "Whatever"
            more_stuff: "Cool"
        /key-123457
            things: "A car"
            more_things: "A truck"