DEV Community

Discussion on: Hide Firebase API Keys in ReactJS Project using Environment Variables

Collapse
 
adelpro profile image
adelpro

These api keys are public keys, to protect you firebase project from unauthorized access you have to use the new "App check" from the firebase team ( in beta stage)
Link: firebase.google.com/docs/app-check

Collapse
 
derick4l profile image
Derick McMillian

So you're saying doing this App Check is mandatory in order for the env variables to work?

Collapse
 
adelpro profile image
adelpro

Im saying that after doing the ""App Check", api key can be shared in public, because it will work only if the request comme from an authorized domaine (YOUR WEB SITE FOR EXEMPLE) else the request will be rejected even with the correct API.

Thread Thread
 
derick4l profile image
Derick McMillian

Nice. I understand now, thanks.

Thread Thread
 
adelpro profile image
adelpro

You are welcome

Collapse
 
ayushdev_24 profile image
Ayush Agarwal

This is really a nice suggestion. Thanks a lot for mentioning it Adelpro !

Collapse
 
adelpro profile image
adelpro

You are welcome