Back to Firebase Js Sdk

Dependencies interface

docs-devsite/auth.dependencies.md

12.12.14.1 KB
Original Source

Project: /docs/reference/js/_project.yaml Book: /docs/reference/_book.yaml page_type: reference

{% comment %} DO NOT EDIT THIS FILE! This is generated by the JS SDK team, and any local changes will be overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %}

Dependencies interface

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

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 cordovaPopupRedirectResolver<!-- -->. 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.

<b>Signature:</b>

typescript
export interface Dependencies 

Properties

PropertyTypeDescription
errorMapAuthErrorMapWhich AuthErrorMap to use.
persistencePersistence | Persistence<!-- -->[]Which Persistence to use. If this is an array, the first <code>Persistence</code> that the device supports is used. The SDK searches for an existing account in order and, if one is found in a secondary <code>Persistence</code>, the account is moved to the primary <code>Persistence</code>.<!-- -->If no persistence is provided, the SDK falls back on inMemoryPersistence<!-- -->.
popupRedirectResolverPopupRedirectResolverThe PopupRedirectResolver to use. This value depends on the platform. Options are browserPopupRedirectResolver and cordovaPopupRedirectResolver<!-- -->. This field is optional if neither signInWithPopup() or signInWithRedirect() are being used.

Dependencies.errorMap

Which AuthErrorMap to use.

<b>Signature:</b>

typescript
errorMap?: AuthErrorMap;

Dependencies.persistence

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<!-- -->.

<b>Signature:</b>

typescript
persistence?: Persistence | Persistence[];

Dependencies.popupRedirectResolver

The PopupRedirectResolver to use. This value depends on the platform. Options are browserPopupRedirectResolver and cordovaPopupRedirectResolver<!-- -->. This field is optional if neither signInWithPopup() or signInWithRedirect() are being used.

<b>Signature:</b>

typescript
popupRedirectResolver?: PopupRedirectResolver;