firecmsco / firecms

Awesome Firebase/Firestore-based CMS. The missing admin panel for your Firebase project!
https://firecms.co
Other
1.13k stars 185 forks source link

Connecting to Firebase Emulators #565

Closed marcello-palmitessa closed 10 months ago

marcello-palmitessa commented 10 months ago

Hello! I'm using the onFirebaseInit prop for the but the app still connect to the production firebase.

    onFirebaseInit={(config: object, app: FirebaseApp) => {
      if (import.meta.env.VITE_FIREBASE_USE_EMULATOR === true) {
        const db = getFirestore();
        const storage = getStorage();
        const auth = getAuth();

        connectAuthEmulator(auth, 'http://127.0.0.1:9099');
        connectFirestoreEmulator(db, '127.0.0.1', 8080);
        connectStorageEmulator(storage, "127.0.0.1", 9199);
      }
    }}

Please any idea how to have this to work?

Thanks

marcello-palmitessa commented 10 months ago

Sorry my mistake, it's working... I had to change this line: if (import.meta.env.VITE_FIREBASE_USE_EMULATOR === 'true') {