DEV Community

Firebase API Key Security Issue – for Custom Sign Up/Login

Sowmo0509 on May 01, 2021

Hello! Hope you're having a good day. I was working on a project where I am making a user input form with HTML, JavaScript but when I inspect usin...
Collapse
 
sowmo0509 profile image
Sowmo0509 • Edited

Note to self after almost an year:

Use ENV (environment) variables and learn NodeJS and Express
I have learned Node and Express so now it's quite simple just put it inside an .env and work like process.env.apiKeyName so that's how simple it is. The ENV file can not be seen cause it's processing in the backend via Node server and boom, you're just fetching stuffs without exposing anything.

Collapse
 
lamba3 profile image
LaMbA3

I think that api are publicly available and that is somewhat okay, that is why there are rules that control access to database.

Collapse
 
sowmo0509 profile image
Sowmo0509

Hey man! Thanks for your quick response. But, guess, if someone steal my API keys and use them in their website or something, and they are just letting users randomly spam with data– that's an issue there, right? Or am I just overthinking about it? Need to understand.