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 > Auth

Auth interface

Interface representing Firebase Auth service.

Signature:

export interface Auth 

Description

See Firebase Authentication for a full guide on how to use the Firebase Auth service.

Properties

Property Type Description
config Config The Config used to initialize this instance.
currentUser User | null The currently signed-in user (or null).
emulatorConfig EmulatorConfig | null The current emulator configuration (or null).
languageCode string | null The Auth instance's language code.
name string The name of the app associated with the Auth service instance.
settings AuthSettings The Auth instance's settings.
tenantId string | null The Auth instance's tenant ID.

Methods

Method Description
onAuthStateChanged(nextOrObserver, error, completed) Adds an observer for changes to the user's sign-in state.
onIdTokenChanged(nextOrObserver, error, completed) Adds an observer for changes to the signed-in user's ID token.
setPersistence(persistence) Changes the type of persistence on the Auth instance.
signOut() Signs out the current user.
updateCurrentUser(user) Asynchronously sets the provided user as Auth.currentUser on the Auth instance.
useDeviceLanguage() Sets the current language to the default device/browser preference.