We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'd like to connect to the local emulators for Firestore and Auth, here is a code sample that works using native Firebase packages:
import { initializeApp } from "firebase/app"; import { connectFirestoreEmulator, getFirestore } from "firebase/firestore"; import { connectAuthEmulator, getAuth } from "firebase/auth"; import { firebaseConfig } from "./env"; export const app = initializeApp(firebaseConfig); export const db = getFirestore(app); connectFirestoreEmulator(db, "127.0.0.1", 8080); export const auth = getAuth(app); connectAuthEmulator(auth, "http://127.0.0.1:9099");
How can I implement this code using "react-admin-firebase"?
The text was updated successfully, but these errors were encountered:
im not saying its the right way but its how i got things to work:
import firebase from "firebase/compat/app"; import "firebase/compat/firestore"; import "firebase/compat/storage"; import "firebase/compat/auth"; import { getFunctions, connectFunctionsEmulator } from "firebase/functions"; import { getFirestore, connectFirestoreEmulator } from "firebase/firestore"; import { FirebaseAuthProvider, FirebaseDataProvider, } from "react-admin-firebase/dist/src";
let firebaseApp;
if (!firebase.apps.length) { firebaseApp = firebase.initializeApp(firebaseConfig); } else { firebaseApp = firebase.app(); // if already initialized, use that one } export const storage = getStorage(firebaseApp); export const functions = getFunctions(firebaseApp);
const auth = firebase.auth(firebaseApp); const db = getFirestore(); const isDevelopment = process.env.NODE_ENV === "development" || process.env.FUNCTIONS_EMULATOR === "true";
if (isDevelopment) { connectFunctionsEmulator(functions, "127.0.0.1", 5001); auth.useEmulator("http://127.0.0.1:9099"); connectFirestoreEmulator(db, "localhost", 8080); connectStorageEmulator(storage, "localhost", 9199); }
const dataProvider = FirebaseDataProvider(firebaseConfig, { app: firebaseApp, });
const authProvider = FirebaseAuthProvider(firebaseConfig, { app: firebaseApp, });
Sorry, something went wrong.
No branches or pull requests
I'd like to connect to the local emulators for Firestore and Auth,
here is a code sample that works using native Firebase packages:
How can I implement this code using "react-admin-firebase"?
The text was updated successfully, but these errors were encountered: