Webhooks for Firebase
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dashboard
firebase
public
.gitignore
README.md
firebase.json
index.js
package.json

README.md

Webhooks for Firebase

Firebase currently does not have support for webhooks. This project is an attempt to fill that gap.

Using Firebase webhooks

  1. Log in to the dashboard using your GitHub account.
  2. Use the form provided to add a webhook for the Firebase URL and event you'd like to listen on.
  3. Optionally provide a custom authentication token or Firebase Secret if the data at the provided path is not publicly readable.
  4. Fill in a payload URL which we can POST data to.

At your payload URL, you should start receiving POST requests with a JSON body that looks like this:

{
	"event": {
		"ref": "The Firebase URL you provided to create this webhook.",
		"type": "The Firebase event you're listening on for this webhook."
	},
	"ref": "The Firebase URL for this DataSnapshot.",
	"key": "The key() of this DataSnapshot.",
	"previous": "The previous child key emitted before this DataSnapshot.",
	"value": "The exportVal() for this DataSnapshot."
}

Please note that updates may be sent again if the listening server is changed and needs to be redeployed.

Disclaimer

This is a plaything. It may or may not send duplicate updates or none at all. It may or may not fall over. It may or may not hammer your server. Use with caution!

Contributing

I'd love some help in making this a bit more robust and stable so that I feel comfortable removing the disclaimer above.

TODO

  • validate form input (e.g. make sure URLs are URLs)
  • add tests for dashboard
  • add tests for webhook server/listeners
  • add throttling/rate limiting
  • stop webhook on hard failure (e.g. new Firebase() exceptions)
  • stop/pause webhook after x failed requests
  • log all webhook requests/responses for debugging