Well, you can use the Firebase REST API, in which case I used for my chrome application and its performance. This does not require the addition of a Firebase SDK!
Read the following docs, https://firebase.googleblog.com/2014/03/announcing-streaming-for-firebase-rest.html
https://firebase.google.com/docs/reference/rest/database/
https://firebase.google.com/docs/database/rest/retrieve-data
The approach is very simple.
The protocol is known as SSE (events sent by the server) , where you listen to a specific server URL and when something changes, you get an event callback.
In this case, firebase officially provides the SSE-based engine.
Code snippet example
//firebaseUrl will be like https://xxxxx.firebaseio.com/yourNode.json or https://xxxxx.firebaseio.com/yourNode/.json //notice ".json" at the end of URL, whatever node you want to listen, add .json as suffix var firebaseEventSS = new EventSource(firebaseUrl); //and you will have callbacks where you get the data firebaseEventSS.addEventListener("patch", function (e) { var data = e.data; }, false); firebaseEventSS.addEventListener("put", function (e) { var data = e.data; }, false);
Just check out a few EventSource Examples and combine with the Firebase Doc for the REST API and you're all set!
Remember to close () when this is done.
firebaseEventSS.close();
source share