firebase-config.json
for each env and use a switch in source code to determine which to use./__/firebase/init.json
(or script in /__/firebase/init.js
) that firebase hosting prepares for each project separately so I can init the correct instance of the firebase app for that environment. Also see the blog post here
What I can't figure out is: fetching the special js/json file over the network is async and in the meantime the react app is initialising and requires the firebase app for auth and other operations. Is there a way I can complete the firebase init and have a firebase app instance ready before react has started-up?
To integrate Firebase into our React app, we need to first get the web configuration object and then use it to initialize Firebase in our react app. Copy the config to the clipboard; we'll need it later on to initialize Firebase. Then, click Continue to console to complete the process.
firebase setup:web --json
has been deprecated.
You can now use firebase apps:sdkconfig web --json
instead.
Full info here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With