- create a .env file in the root directory
VITE_apiKey=zahtddfrsfSyCHJYZaDa9s47oP4L7Cc
VITE_authDomain=firebaseapp.firebaseapp.com
VITE_databaseURL=https://firebaseapp.firebaseio.com
VITE_projectId=firebaseapp
VITE_storageBucket=firebaseapp.appspot.com
VITE_messagingSenderId=200000020053535353535353535353
VITE_appId=1:50000000080792:web:6676767676d766d7676sw6
- then in the app
const firebaseConfig = {
apiKey: import.meta.env.VITE_apiKey,
authDomain: import.meta.env.VITE_authDomain,
databaseURL: import.meta.env.VITE_databaseURL,
projectId: import.meta.env.VITE_projectId,
storageBucket: import.meta.env.VITE_storageBucket,
messagingSenderId: import.meta.env.VITE_messagingSenderI,
appId: import.meta.env.VITE_appId,
};
remember to include .env it in the .gitignore