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

Dependencies interface

The dependencies that can be used to initialize an Auth instance.

Signature:

export interface Dependencies 

Description

The modular SDK enables tree shaking by allowing explicit declarations of dependencies. For example, a web app does not need to include code that enables Cordova redirect sign in. That functionality is therefore split into browserPopupRedirectResolver and . The dependencies object is how Auth is configured to reduce bundle sizes.

There are two ways to initialize an auth instance: getAuth() and initializeAuth(). getAuth initializes everything using platform-specific configurations, while initializeAuth takes a Dependencies object directly, giving you more control over what is used.

Properties

Property Type Description
errorMap? AuthErrorMap (Optional) Which AuthErrorMap to use.
persistence? Persistence | Persistence[] (Optional) Which Persistence to use. If this is an array, the first Persistence that the device supports is used. The SDK searches for an existing account in order and, if one is found in a secondary Persistence, the account is moved to the primary Persistence.If no persistence is provided, the SDK falls back on inMemoryPersistence.
popupRedirectResolver? PopupRedirectResolver (Optional) The PopupRedirectResolver to use. This value depends on the platform. Options are browserPopupRedirectResolver and . This field is optional if neither signInWithPopup() or signInWithRedirect() are being used.