Skip to content

AuthInterceptorOptions

Defined in: packages/api-client/src/core/interceptors/authInterceptor.ts:32

optional authRouteFragments?: readonly string[]

Defined in: packages/api-client/src/core/interceptors/authInterceptor.ts:54

Optional override of the auth-route fragments. Defaults to DEFAULT_AUTH_ROUTE_FRAGMENTS.


optional getAnonymousId?: () => 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.

Promise<string>


optional getLanguage?: () => 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.

Awaitable<string | null | undefined>


optional getSessionToken?: () => 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.

Awaitable<string | null | undefined>