Skip to content

Interface: FetchTransportOptions

Interface: FetchTransportOptions

Defined in: auth-client/src/core/adapters/fetch-transport.ts:21

Properties

attachAuthHeader

attachAuthHeader: boolean

Defined in: auth-client/src/core/adapters/fetch-transport.ts:27

When false, Authorization header is never attached regardless of skipAuth — useful when the host app uses cookies for auth and doesn’t want a duplicate Bearer header confusing the server.


fetchImpl?

optional fetchImpl?: {(input, init?): Promise<Response>; (input, init?): Promise<Response>; }

Defined in: auth-client/src/core/adapters/fetch-transport.ts:29

Optional custom fetch — used by SSR (node-fetch) and tests.

Call Signature

(input, init?): Promise<Response>

MDN Reference

Parameters
input

RequestInfo | URL

init?

RequestInit

Returns

Promise<Response>

Call Signature

(input, init?): Promise<Response>

MDN Reference

Parameters
input

string | Request | URL

init?

RequestInit

Returns

Promise<Response>


retry?

optional retry?: RetryOptions

Defined in: auth-client/src/core/adapters/fetch-transport.ts:37

Retry configuration for transient failures (network errors + 5xx). 4xx responses are NEVER retried — those are user errors and a retry would just hide the misconfiguration. Pass { maxAttempts: 1 } to disable retries entirely. Default: 3 attempts with exponential backoff (200ms, 500ms) + 0–50ms jitter.


tokenProvider

tokenProvider: () => Promise<string | null>

Defined in: auth-client/src/core/adapters/fetch-transport.ts:23

Returns the current access token, or null if not authenticated.

Returns

Promise<string | null>