Type Aliases ClaimValidationError ClaimValidationError: { id: string ; reason?: any }
Type declaration id: string Optional reason?: any ClaimValidationResult ClaimValidationResult: { isValid: true } | { isValid: false ; reason?: any }
InputType InputType: { apiBasePath?: string ; apiDomain: string ; autoAddCredentials?: boolean ; cookieHandler?: CookieHandlerInput ; dateProvider?: DateProviderInput ; enableDebugLogs?: boolean ; invalidClaimStatusCode?: number ; isInIframe?: boolean ; lockFactory?: LockFactory ; maxRetryAttemptsForSessionRefresh?: number ; onHandleEvent?: EventHandler ; override?: { functions?: any } ; postAPIHook?: RecipePostAPIHookFunction ; preAPIHook?: RecipePreAPIHookFunction ; sessionExpiredStatusCode?: number ; sessionTokenBackendDomain?: string ; sessionTokenFrontendDomain?: string ; tokenTransferMethod?: "cookie" | "header" ; windowHandler?: WindowHandlerInput }
Type declaration Optional apiBasePath?: string apiDomain: string Optional autoAddCredentials?: boolean Optional cookieHandler?: CookieHandlerInput Optional dateProvider?: DateProviderInput Optional enableDebugLogs?: boolean Optional invalidClaimStatusCode?: number Optional isInIframe?: boolean Optional lockFactory?: LockFactory Optional maxRetryAttemptsForSessionRefresh?: number Optional onHandleEvent?: EventHandler Optional override?: { functions?: any } Optional postAPIHook?: RecipePostAPIHookFunction Optional preAPIHook?: RecipePreAPIHookFunction Optional sessionExpiredStatusCode?: number Optional sessionTokenBackendDomain?: string Optional sessionTokenFrontendDomain?: string Optional tokenTransferMethod?: "cookie" | "header" Optional windowHandler?: WindowHandlerInput RecipeInterface RecipeInterface: { addAxiosInterceptors: any ; addFetchInterceptorsAndReturnModifiedFetch: any ; addXMLHttpRequestInterceptor: any ; calculateClockSkewInMillis: any ; doesSessionExist: any ; getAccessTokenPayloadSecurely: any ; getGlobalClaimValidators: any ; getInvalidClaimsFromResponse: any ; getUserId: any ; shouldDoInterceptionBasedOnUrl: any ; signOut: any ; validateClaims: any }
Type declaration addAxiosInterceptors: function addAxiosInterceptors( input: { axiosInstance: any ; userContext: any } ) : void Parameters input: { axiosInstance: any ; userContext: any } axiosInstance: any userContext: any Returns void addFetchInterceptorsAndReturnModifiedFetch: function addFetchInterceptorsAndReturnModifiedFetch( input: { originalFetch: any ; userContext: any } ) : ( ( input: URL | RequestInfo , init?: RequestInit ) => Promise < Response > ) Parameters input: { originalFetch: any ; userContext: any } originalFetch: any userContext: any Returns ( ( input: URL | RequestInfo , init?: RequestInit ) => Promise < Response > ) ( input: URL | RequestInfo , init?: RequestInit ) : Promise < Response > Parameters input: URL | RequestInfo Optional init: RequestInit Returns Promise < Response > addXMLHttpRequestInterceptor: function addXMLHttpRequestInterceptor( input: { userContext: any } ) : void Parameters input: { userContext: any } Returns void calculateClockSkewInMillis: function calculateClockSkewInMillis( params: { accessTokenPayload: any ; responseHeaders: Headers } ) : number Parameters params: { accessTokenPayload: any ; responseHeaders: Headers } accessTokenPayload: any responseHeaders: Headers Returns number doesSessionExist: function doesSessionExist( input: { userContext: any } ) : Promise < boolean > Parameters input: { userContext: any } Returns Promise < boolean > getAccessTokenPayloadSecurely: function getAccessTokenPayloadSecurely( input: { userContext: any } ) : Promise < any > Parameters input: { userContext: any } Returns Promise < any > getGlobalClaimValidators: function getInvalidClaimsFromResponse: function getInvalidClaimsFromResponse( input: { response: { data: any } | Response ; userContext: any } ) : Promise < ClaimValidationError [] > Parameters input: { response: { data: any } | Response ; userContext: any } response: { data: any } | Response userContext: any getUserId: function getUserId( input: { userContext: any } ) : Promise < string > Parameters input: { userContext: any } Returns Promise < string > shouldDoInterceptionBasedOnUrl: function shouldDoInterceptionBasedOnUrl( toCheckUrl: string , apiDomain: string , sessionTokenBackendDomain: undefined | string ) : boolean Parameters toCheckUrl: string apiDomain: string sessionTokenBackendDomain: undefined | string Returns boolean signOut: function signOut( input: { userContext: any } ) : Promise < void > Parameters input: { userContext: any } Returns Promise < void > validateClaims: function SessionClaim SessionClaim< ValueType > : { getLastFetchedTime: any ; getValueFromPayload: any ; refresh: any }
Type Parameters Type declaration getLastFetchedTime: function getLastFetchedTime( payload: any , _userContext?: any ) : undefined | number Parameters payload: any Optional _userContext: any Returns undefined | number getValueFromPayload: function getValueFromPayload( payload: any , _userContext?: any ) : undefined | ValueType Parameters payload: any Optional _userContext: any Returns undefined | ValueType refresh: function refresh( userContext: any ) : Promise < void > Parameters Returns Promise < void > SessionClaimValidator SessionClaimValidator: { id: string ; refresh: any ; shouldRefresh: any ; validate: any }
Type declaration Readonly id: string refresh: function refresh( userContext: any ) : Promise < void > Parameters Returns Promise < void > shouldRefresh: function shouldRefresh( accessTokenPayload: any , userContext: any ) : boolean | Promise < boolean > Parameters accessTokenPayload: any userContext: any Returns boolean | Promise < boolean > validate: function Parameters accessTokenPayload: any userContext: any
This allows for a Lock factory to be configured, which defaults to browser-tabs-lock. This can be used, for example, by a WebExtension that needs to update cookies for a domain that may or may not have an associated tab open.