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/auth > useAuthEmulator

useAuthEmulator() function

Changes the Auth instance to communicate with the Firebase Auth Emulator, instead of production Firebase Auth services.

Signature:

export declare function useAuthEmulator(auth: Auth, url: string, options?: {
    disableWarnings: boolean;
}): void;

Parameters

Parameter Type Description
auth Auth The Auth instance.
url string The URL at which the emulator is running (eg, 'http://localhost:9099').
options

Returns:

void

Description

This must be called synchronously immediately following the first call to initializeAuth(). Do not use with production credentials as emulator traffic is not encrypted.

Example

useAuthEmulator(auth, 'http://127.0.0.1:9099', { disableWarnings: true });