AuthInterceptorOptions
Defined in: packages/api-client/src/core/interceptors/authInterceptor.ts:32
Properties
Section titled “Properties”authRouteFragments?
Section titled “authRouteFragments?”
optionalauthRouteFragments?: readonlystring[]
Defined in: packages/api-client/src/core/interceptors/authInterceptor.ts:54
Optional override of the auth-route fragments. Defaults to
DEFAULT_AUTH_ROUTE_FRAGMENTS.
getAnonymousId?
Section titled “getAnonymousId?”
optionalgetAnonymousId?: () =>Promise<string>
Defined in: packages/api-client/src/core/interceptors/authInterceptor.ts:49
Resolves the anonymous id used when no session token is available.
Required for the anonymous fallback to work; if omitted, requests on
non-auth routes without a token go out without an Authorization
header.
Returns
Section titled “Returns”Promise<string>
getLanguage?
Section titled “getLanguage?”
optionalgetLanguage?: () =>Awaitable<string|null|undefined>
Defined in: packages/api-client/src/core/interceptors/authInterceptor.ts:42
Resolves the user’s preferred language. When provided and the request
does not already carry X-Accept-Language, the value is attached.
Returns
Section titled “Returns”Awaitable<string | null | undefined>
getSessionToken?
Section titled “getSessionToken?”
optionalgetSessionToken?: () =>Awaitable<string|null|undefined>
Defined in: packages/api-client/src/core/interceptors/authInterceptor.ts:37
Resolves the session token. Returning null/undefined skips token
injection and falls back to the anonymous id flow.
Returns
Section titled “Returns”Awaitable<string | null | undefined>