PeterEfland / react-ecommerce

0 stars 0 forks source link

API key in clear text #4

Open w3bdesign opened 5 years ago

w3bdesign commented 5 years ago

Just a friendly tip, in react-ecommerce/src/firebase/firebase.utils.js your API key is visible publicly.

I highly recommend you look into storing the api key somewhere not publicly available. For example, look at https://thatweirddeveloper.com/how-to-switch-firebase-project-using-dotenv

Essentially you should store the API key in a .env file and get access to the information as a constant. Remember to make sure that the .env file is in your .gitignore file!

w3bdesign commented 4 years ago

@PeterEfland https://create-react-app.dev/docs/adding-custom-environment-variables/