Dependencies interface

The dependencies that can be used to initialize anAuth 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 intobrowserPopupRedirectResolver andcordovaPopupRedirectResolver. The dependencies object is how Auth is configured to reduce bundle sizes.

There are two ways to initialize anAuth instance:getAuth() andinitializeAuth().getAuth initializes everything using platform-specific configurations, whileinitializeAuth takes aDependencies object directly, giving you more control over what is used.

Signature:

exportinterfaceDependencies

Properties

PropertyTypeDescription
errorMapAuthErrorMapWhichAuthErrorMap to use.
persistencePersistence |Persistence[]WhichPersistence to use. If this is an array, the firstPersistence that the device supports is used. The SDK searches for an existing account in order and, if one is found in a secondaryPersistence, the account is moved to the primaryPersistence.If no persistence is provided, the SDK falls back oninMemoryPersistence.
popupRedirectResolverPopupRedirectResolverThePopupRedirectResolver to use. This value depends on the platform. Options arebrowserPopupRedirectResolver andcordovaPopupRedirectResolver. This field is optional if neithersignInWithPopup() orsignInWithRedirect() are being used.

Dependencies.errorMap

WhichAuthErrorMap to use.

Signature:

errorMap?:AuthErrorMap;

Dependencies.persistence

WhichPersistence to use. If this is an array, the firstPersistence that the device supports is used. The SDK searches for an existing account in order and, if one is found in a secondaryPersistence, the account is moved to the primaryPersistence.

If no persistence is provided, the SDK falls back oninMemoryPersistence.

Signature:

persistence?:Persistence|Persistence[];

Dependencies.popupRedirectResolver

ThePopupRedirectResolver to use. This value depends on the platform. Options arebrowserPopupRedirectResolver andcordovaPopupRedirectResolver. This field is optional if neithersignInWithPopup() orsignInWithRedirect() are being used.

Signature:

popupRedirectResolver?:PopupRedirectResolver;

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-01-19 UTC.