firebase-rest-api
firebase-rest-api copied to clipboard
Implement listen for Firestore
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
Hello @dwatrous , thank you for submitting an issue! A project committer will shortly review the issue.
Could you provide me the source of the endpoint?
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.
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.