Type Aliases Claim Validation Error Claim Validation Error: { id: string ; reason?: any }
Type declaration id: string Optional reason?: any Claim Validation Result Claim Validation Result: { isValid: true } | { isValid: false ; reason?: any }
Input Type Input Type: { 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 api Base Path?: string api Domain: string Optional auto Add Credentials?: boolean Optional cookie Handler?: CookieHandlerInput Optional date Provider?: DateProviderInput Optional enable Debug Logs?: boolean Optional invalid Claim Status Code?: number Optional is In Iframe?: boolean Optional lock Factory?: LockFactory Optional max Retry Attempts For Session Refresh?: number Optional on Handle Event?: EventHandler Optional override?: { functions?: any } Optional postAPIHook?: RecipePostAPIHookFunction Optional preAPIHook?: RecipePreAPIHookFunction Optional session Expired Status Code?: number Optional session Token Backend Domain?: string Optional session Token Frontend Domain?: string Optional token Transfer Method?: "cookie" | "header" Optional window Handler?: WindowHandlerInput Recipe Interface Recipe Interface: { 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 add Axios Interceptors: function add Axios Interceptors( input: { axiosInstance: any ; userContext: any } ) : void Parameters input: { axiosInstance: any ; userContext: any } axios Instance: any user Context: any Returns void add Fetch Interceptors And Return Modified Fetch: function add Fetch Interceptors And Return Modified Fetch( input: { originalFetch: any ; userContext: any } ) : ( ( input: URL | RequestInfo , init?: RequestInit ) => Promise < Response > ) Parameters input: { originalFetch: any ; userContext: any } original Fetch: any user Context: 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 > addXMLHttp Request Interceptor: function addXMLHttp Request Interceptor( input: { userContext: any } ) : void Parameters input: { userContext: any } Returns void calculate Clock Skew In Millis: function calculate Clock Skew In Millis( params: { accessTokenPayload: any ; responseHeaders: Headers } ) : number Parameters params: { accessTokenPayload: any ; responseHeaders: Headers } access Token Payload: any response Headers: Headers Returns number does Session Exist: function does Session Exist( input: { userContext: any } ) : Promise < boolean > Parameters input: { userContext: any } Returns Promise < boolean > get Access Token Payload Securely: function get Access Token Payload Securely( input: { userContext: any } ) : Promise < any > Parameters input: { userContext: any } Returns Promise < any > get Global Claim Validators: function get Invalid Claims From Response: function get Invalid Claims From Response( input: { response: { data: any } | Response ; userContext: any } ) : Promise < ClaimValidationError [] > Parameters input: { response: { data: any } | Response ; userContext: any } response: { data: any } | Response user Context: any get User Id: function get User Id( input: { userContext: any } ) : Promise < string > Parameters input: { userContext: any } Returns Promise < string > should Do Interception Based On Url: function should Do Interception Based On Url( toCheckUrl: string , apiDomain: string , sessionTokenBackendDomain: undefined | string ) : boolean Parameters toCheckUrl: string apiDomain: string sessionTokenBackendDomain: undefined | string Returns boolean sign Out: function sign Out( input: { userContext: any } ) : Promise < void > Parameters input: { userContext: any } Returns Promise < void > validate Claims: function Session Claim Session Claim< ValueType > : { getLastFetchedTime: any ; getValueFromPayload: any ; refresh: any }
Type Parameters Type declaration get Last Fetched Time: function get Last Fetched Time( payload: any , _userContext?: any ) : undefined | number Parameters payload: any Optional _userContext: any Returns undefined | number get Value From Payload: function get Value From Payload( 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 > Session Claim Validator Session Claim Validator: { id: string ; refresh: any ; shouldRefresh: any ; validate: any }
Type declaration Readonly id: string refresh: function refresh( userContext: any ) : Promise < void > Parameters Returns Promise < void > should Refresh: function should Refresh( 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.