FirebaseExtended / reactfire

Hooks, Context Providers, and Components that make it easy to interact with Firebase.
https://firebaseopensource.com/projects/firebaseextended/reactfire/
MIT License
3.51k stars 399 forks source link

Can we fetch firebase config by api? #526

Closed mohitsud closed 2 years ago

mohitsud commented 2 years ago

I have a multi tenant application where each tenant has its own unique firebase instance.

I would like to retrieve the firebase config data via an api call. I will be able to secure this as my api will receive a separate Auth token.

Could anyone provide guidance on how I can make the API call before initializing firebase?

jhuleatt commented 2 years ago

If you're using Firebase Hosting, your Firebase config is available at the reserved /__/firebase/init.json path. For example, https://<firebase-project-id>.web.app/__/firebase/init.json or <your-custom-domain>/__/firebase/init.json.

This can be found in the Firebase docs at the bottom of the SDK auto-configuration section.

mohitsud commented 2 years ago

Thank you.