I have initialised my firebase app as follows.
const PRODUCTION = false;
let firebaseConfig = {
apiKey,
...
};
// Initialize Firebase
// Check if any Firebase apps exist
const apps = getApps();
// Initialize only if no apps exist
const app = !apps.length ? initializeApp(firebaseConfig) : apps[0];
export const auth = getAuth(app);
const firestore = getFirestore(app);
if(!PRODUCTION){
connectAuthEmulator(auth, "http://localhost:9099");
connectFirestoreEmulator(firestore, "localhost", 8080);
}
This works great, but I then get a warning saying don't use production credentials when using emulators. I think that is what I am doing though.
What is the correct way to initialise firebase with emulators?
Unsure what the best practice is in this situation.