How can I make a Google DataStore database publicy readable?

I have a Datastore instance that contains public data. I want website users to query the database when they visit a particular url. Once the data is fetched, I'll use javascript to aggregate and display the data. It's a static site so I can't do this from a back end.

Is it possible to do this without creating a service account and using credentials? Cloud functions has the allUsers permission and I was hoping there is something similar for Datastore?

If it isn't possible to make the data public, I guess I could use a Cloud function. But I'd like to confirm there isn't a simpler solution first.

1 answer

  • answered 2021-06-18 01:40 Juan Lara

    This is a use case that's supported with Firestore in Native mode and the Firebase Web SDK (docs).

    For Datastore, you are correct. You need to use a service account and something like a Cloud Function to make a back-end.