The Firebase JS SDK is now in BETA!
This EAP site is no longer maintained. See the official Firebase Documentation site for the latest documentation and information about the Firebase JS SDK.

Home > @firebase/database > useDatabaseEmulator

useDatabaseEmulator() function

Modify the provided instance to communicate with the Realtime Database emulator.

Note: This method must be called before performing any other operation.

Signature:

export declare function useDatabaseEmulator(db: FirebaseDatabase, host: string, port: number): void;

Parameters

Parameter Type Description
db FirebaseDatabase The instance to modify.
host string The emulator host (ex: localhost)
port number The emulator port (ex: 8080)

Returns:

void