Shai Ben-Tovim
Shai Ben-Tovim

Reputation: 932

Auto config Firebase SDK in React

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?

Upvotes: 10

Views: 1268

Answers (2)

paintedbicycle
paintedbicycle

Reputation: 297

firebase setup:web --json has been deprecated.

You can now use firebase apps:sdkconfig web --json instead.

Full info here.

Upvotes: 3

Shai Ben-Tovim
Shai Ben-Tovim

Reputation: 932

Found this firebase-CLI command:

firebase setup:web --json

It will output the json required for initialising the firebase app based on the active firebase app (firebase use). Just need to include the resulting json in the build chain.

Upvotes: 2

Related Questions