RefirebaseRefirebase

Firebase Emulators

Connecting to local Firebase Emulators for development.

Usage

Refirebase automatically connects to the Firebase Local Emulator Suite if you set the useEmulators flag to true. You don't need to manually import or configure the connection methods.

.env
// .env.local
FIREBASE_USE_EMULATORS=true
FIREBASE_PROJECT_ID=demo-project
firebase.ts
import { Refirebase } from 'refirebase';

// Just pass useEmulators: true in the config object
// OR rely on the FIREBASE_USE_EMULATORS env var.
const firebase = new Refirebase({
  useEmulators: true
});

// Emulators automatically bind to standard ports:
// Firestore: 8080
// Auth: 9099
// Realtime DB: 9000
// Storage: 9199

Default Ports

Refirebase expects the emulators to be running on their default ports. Ensure your firebase.json matches these values:

EmulatorDefault Host:Port
Firestorehttp://localhost:8080
Authhttp://localhost:9099
Realtime DBhttp://localhost:9000
Storagehttp://localhost:9199