the-road-to-react-with-firebase / react-firebase-authentication

🔥 Boilerplate Project for Authentication with Firebase in React.
https://www.robinwieruch.de
1.01k stars 296 forks source link

How can i hide config values? #42

Open juaniarguello opened 3 years ago

juaniarguello commented 3 years ago

One question, are the firebase config values ​​(ie the apiKey, appId, etc ..) meant to be exposed or should we hide them in some way? Thank you!

mejustdev commented 3 years ago

If you are using version control system like git, It is a secure way to create .env file in the root of the project and store those secrets in there. Don't forget to add .env in .gitignore

erikswed commented 3 years ago

They are by design not able to hide for anyone with skills to debunk your code. What you must do is infors Website restrictions and Authorised JavaScript origins from https://console.developers.google.com/apis/credentials/ So that the api key only can be used from your Doman!