The protocol that Firebase uses to communicate with its client libraries is not a documented API. You may be able to rebuild it, but since it is not a documented API, it can change at any time.
You might want to explore Firebase REST Streaming , which lets you listen to changes in location. Here is an example of what the server could send, for documents:
// Set your entire cache to {"a": 1, "b": 2} event: put data: {"path": "/", "data": {"a": 1, "b": 2}} // Put the new data in your cache under the key 'c', so that the complete cache now looks like: // {"a": 1, "b": 2, "c": {"foo": true, "bar": false}} event: put data: {"path": "/c", "data": {"foo": true, "bar": false}}
Also, the Firebase client that @Anant mentions in his comment is an outdated version that is very old.
source share