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.
Signature:
export interface Dependencies
Properties
Property | Type | Description |
---|---|---|
errorMap | AuthErrorMap | Which AuthErrorMap to use. |
persistence | Persistence | 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. |
popupRedirectResolver | 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. |
Dependencies.errorMap
Which AuthErrorMap to use.
Signature:
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.
Signature:
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.
Signature:
popupRedirectResolver?: PopupRedirectResolver;