Should be the full request URL for your refresh session API endpoint.
This function will send a POST request to it.
sessionExpiredStatusCode (Optional)
Type: number
Default: 401
HTTP status code that indicates session expiry - as sent by your APIs.
viaInterceptor (Optional)
Type: boolean
Default: false
If true, all network calls made using fetch are intercepted.
websiteRootDomain (Optional)
Type: string
Default: Same as the domain in the currently loaded URL.
Set this to your website domain across which you want to share a session. For example, if your website domain (that is loaded by the user) is example.com, then the value of this should be example.com. If your site has subdomains that need to keep the same session, like a.example.com and b.example.com, then the value of this should be .example.com.
refreshAPICustomHeaders (Optional)
Type: object
Default: {}
If your refresh API requires any custom headers (for example a version number), then you can provide that in this object. An example is: {api-version: "0"}
autoAddCredentials (Optional)
Type: boolean
Default true
Setting this to true adds credentials: "include" to all requests. This is needed for cross origin requests (website is on example.com and API is on api.example.com)
Returns
void
Throws
Nothing
fetch(url, config?)
Parameters
url
Type: string
Same as what fetch expects.
config (Optional)
Type: object
Same as what fetch expects.
Returns
Identical to the fetch API.
Throws
Identical to the fetch API.
An Error object if the init function is not called.