Stay organized with collections
Save and categorize content based on your preferences.
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.
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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-01-19 UTC."],[],[],null,["# Dependencies interface\n\nThe dependencies that can be used to initialize an [Auth](./auth.auth.md#auth_interface) instance.\n\nThe 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](./auth.md#browserpopupredirectresolver) and [cordovaPopupRedirectResolver](./auth.md#cordovapopupredirectresolver). The dependencies object is how Auth is configured to reduce bundle sizes.\n\nThere are two ways to initialize an [Auth](./auth.auth.md#auth_interface) instance: [getAuth()](./auth.md#getauth_cf608e1) and [initializeAuth()](./auth.md#initializeauth_ca77c9b). `getAuth` initializes everything using platform-specific configurations, while `initializeAuth` takes a `Dependencies` object directly, giving you more control over what is used.\n\n**Signature:** \n\n export interface Dependencies \n\nProperties\n----------\n\n| Property | Type | Description |\n|-----------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [errorMap](./auth.dependencies.md#dependencieserrormap) | [AuthErrorMap](./auth.autherrormap.md#autherrormap_interface) | Which [AuthErrorMap](./auth.autherrormap.md#autherrormap_interface) to use. |\n| [persistence](./auth.dependencies.md#dependenciespersistence) | [Persistence](./auth.persistence.md#persistence_interface) \\| [Persistence](./auth.persistence.md#persistence_interface)\\[\\] | Which [Persistence](./auth.persistence.md#persistence_interface) 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](./auth.md#inmemorypersistence). |\n| [popupRedirectResolver](./auth.dependencies.md#dependenciespopupredirectresolver) | [PopupRedirectResolver](./auth.popupredirectresolver.md#popupredirectresolver_interface) | The [PopupRedirectResolver](./auth.popupredirectresolver.md#popupredirectresolver_interface) to use. This value depends on the platform. Options are [browserPopupRedirectResolver](./auth.md#browserpopupredirectresolver) and [cordovaPopupRedirectResolver](./auth.md#cordovapopupredirectresolver). This field is optional if neither [signInWithPopup()](./auth.md#signinwithpopup_770f816) or [signInWithRedirect()](./auth.md#signinwithredirect_770f816) are being used. |\n\nDependencies.errorMap\n---------------------\n\nWhich [AuthErrorMap](./auth.autherrormap.md#autherrormap_interface) to use.\n\n**Signature:** \n\n errorMap?: AuthErrorMap;\n\nDependencies.persistence\n------------------------\n\nWhich [Persistence](./auth.persistence.md#persistence_interface) 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`.\n\nIf no persistence is provided, the SDK falls back on [inMemoryPersistence](./auth.md#inmemorypersistence).\n\n**Signature:** \n\n persistence?: Persistence | Persistence[];\n\nDependencies.popupRedirectResolver\n----------------------------------\n\nThe [PopupRedirectResolver](./auth.popupredirectresolver.md#popupredirectresolver_interface) to use. This value depends on the platform. Options are [browserPopupRedirectResolver](./auth.md#browserpopupredirectresolver) and [cordovaPopupRedirectResolver](./auth.md#cordovapopupredirectresolver). This field is optional if neither [signInWithPopup()](./auth.md#signinwithpopup_770f816) or [signInWithRedirect()](./auth.md#signinwithredirect_770f816) are being used.\n\n**Signature:** \n\n popupRedirectResolver?: PopupRedirectResolver;"]]