AsifArmanRahman / firebase-rest-api

A simple python wrapper for Google's Firebase REST API's.
https://firebase-rest-api.readthedocs.io
MIT License
60 stars 14 forks source link

Implement listen for Firestore #23

Open dwatrous opened 1 year ago

dwatrous commented 1 year ago

Is your proposal related to a problem?

I would like to use firestore to listen to changes, as is possible with this REST endpoint:
https://firebase.google.com/docs/firestore/reference/rest/v1beta1/projects.databases.documents/listen

Similar functionality is available for the Firebase Realtime Database module of this library, but it would be more convenient to stay in Firestore

Describe the solution you'd like.

`fsdb.collection('messages').listen(callback)`

Describe alternatives you've considered.

I tried implementing this with realtime database, but implementing in my app on flutterflow isn't supported.

Additional context.

No response

github-actions[bot] commented 1 year ago

Hello @dwatrous , thank you for submitting an issue! A project committer will shortly review the issue.

AsifArmanRahman commented 12 months ago

Could you provide me the source of the endpoint?

dwatrous commented 11 months ago

After further review, I don't believe that firestore offers a REST endpoint or other mechanism to listen for changes in realtime. This is possible using the admin sdk, but that requires a service account instead of using the user's id token jwt, so it won't work for my use case.

AsifArmanRahman commented 11 months ago

Yeah some endpoints are allocated to be used with admin creds only. But if you figure out proper conditions and user roles, you can make the service account work for specific user tokens.