Local development

create emulators
export FIREBASE_AUTH_EMULATOR_HOST="127.0.0.1:9099"
export FIREBASE_EMULATOR_HOST="localhost:9099"

firebase init emulators
# init firestore rules locally
firebase init firestore # don't forget disable opened access in access config

# run emulators with
firebase emulators:start [firestore,functions,auth,hosting]
# to keep emulator data
firebase emulators:start [firestore,functions,auth,hosting] [--import=./local] [--export-on-exist]
use them
export function initialize() {
	// init services
	const firestore = ...
	const auth = ...
	const storage = ...

	if (location.hostname === 'localhost') {
        // options are optional to hide warning message injected to page
        connectAuthEmulator(auth, 'http://localhost:9099', { disableWarnings: true })
        connectFirestoreEmulator(firestore, 'localhost', 8080)
    }
	
	return { firebaseApp, firestore, auth, storage }
}