I would like to use Firebase as part of a React app that I am building. According to Add Firebase to your JavaScript Project we should add the following to a node.js project:
// Initialize Firebase
// TODO: Replace with your project's customized code snippet
var config = {
apiKey: "<API_KEY>",
authDomain: "<PROJECT_ID>.firebaseapp.com",
databaseURL: "https://<DATABASE_NAME>.firebaseio.com",
storageBucket: "<BUCKET>.appspot.com",
};
firebase.initializeApp(config);
Is it a security risk to have the
API_KEY
andPROJECT_ID
in a public Git repository?When using the Firebase CLI a
.firebaserc
is created in JSON format, which contains thePROJECT_ID
. Is it a security risk to have this in a public Git repository?
Is it safe to expose Firebase apiKey to the public? discusses exposing the API key to the public but doesn't mention Git or the Project ID.