I'm trying to secure my apiKey.So, I used .env.local file in react js but firebase shows this problem.Many other people asked this question and got their answer but I didn't get my proper answer that's why I'm asking this question again. What is the problem in my file?
// in firebase.init.js file:
import { initializeApp } from "firebase/app";
import { getAuth } from "firebase/auth";
const firebaseConfig = {
apiKey: process.env.REACT_APP_apiKey,
authDomain: process.env.REACT_APP_authDomain,
projectId: rocess.env.REACT_APP_projectId,
storageBucket: process.env.REACT_APP_storageBucket,
messagingSenderId: process.env.REACT_APP_messagingSenderId,
appId: process.env.REACT_APP_appId,
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
const auth = getAuth(app);
export default auth;
in .env.local file:
REACT_APP_apiKey="AIzxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-PXXY0"
REACT_APP_authDomain="waxxxxxxxxxxxxxxxxxxxxxxxxxxxxpp.com"
REACT_APP_projectId="wxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx0"
REACT_APP_storageBucket="waxxxxxxxxxxxxxxxxxxxxxxxt.com"
REACT_APP_messagingSenderId="xxxxxxxxxxxxxxxxxxxxxx7"
REACT_APP_appId="xxxxxxxxxxxxxxxxxxxxxxxxxxa4b8827ef0"