Skip to content

AuthResult

AuthResult = string | { header?: string; scheme?: string; token: string; } | null | undefined

Defined in: packages/fetch-kit/src/types.ts:128

Result returned by an AuthFn.

  • string — used as the value of the Authorization header verbatim. Caller is responsible for any scheme prefix, e.g. "Bearer xyz", "Basic dXNlcjpwYXNz", "Token xyz", or a raw API key.
  • Object form — set a custom header (e.g. "X-Api-Key") and value, and/or keep the convenience of providing scheme + token separately.
  • null / undefined — no auth header added for this request.

string


{ header?: string; scheme?: string; token: string; }

optional header?: string

Header name. Defaults to "Authorization".

optional scheme?: string

Optional scheme prefix joined to token with a single space. Omit to pass token through verbatim — useful for custom schemes or API-key headers that take a raw value.

token: string

The credential value (or full header value when scheme is omitted).


null


undefined