'is react .env file that contains all the firebase keys is secure or should I make a backend?

are firebase keys inside .env file on frontend considered secure the issue here is most and I mean most of the tutorials out there are telling you it is a good practice to put all your keys inside an .env file... (frontend) but in real world could this compromise my database ? I mean why would those tutorials do this thing if this practice could jeopardize your app ? this big question is why there is a react .env on the front end to begin with if it is not secure ?

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source