Hide api keys

Hello, can someone help how to hide firebase api keys from github using react js #❓help-forum
3 Replies
dys 🐙
dys 🐙6mo ago
You put the API keys in a .env file containing environment variables which you import into your program using process.env.VARIABLE_NAME or import.meta.env.VARIABLE_NAME if you're in Vite. You do not commit the .env file into git.
ἔρως
ἔρως6mo ago
also, you store the api key in git secrets and when you deploy, you create the .env file from it
bahatiphilemon
bahatiphilemonOP6mo ago
Thanks for the help

Did you find this page helpful?