Om en refresh-callback redan är registrerad. Låter lagret registrera en gång.
A storefront URL a browser can open on its own (a link, a download): the public key goes in the query, since a link cannot send headers. Only for public, token-guarded resources.
Optionalparams: Record<string, unknown>Execute an HTTP request
Execute an HTTP request that returns binary content (e.g. a PDF download). Shares auth headers, the 401-refresh retry, and error mapping with request, but resolves to a Blob instead of parsed JSON. Response interceptors (JSON-shaped) are intentionally skipped.
Execute a request whose response is a stream (Server-Sent Events) and hand back the raw
Response once its headers have arrived, for the caller to read response.body from.
Shares auth headers, the 401-refresh retry and error mapping with request. The
client's timeout covers only the wait for the headers: once the server has started answering,
the stream lives as long as the caller's signal allows. Response interceptors are skipped,
since there is no parsed body to hand them.
A caller abort before the headers arrive rejects with code ABORTED (not TIMEOUT).
Seed the context from an auth response. Optional: without it the next identified request pays one extra round trip (400 CONTEXT_REQUIRED, then the retry) and heals itself.
ReadonlyinterceptorsExtension point. Register hooks that run around every request:
client.http.interceptors.request.use((ctx) => { ctx.headers["x-tenant"] = "acme" })
client.http.interceptors.response.use((ctx) => { console.log(ctx.response.status) })
client.http.interceptors.error.use((err) => { if (err.isUnauthorized) redirectToLogin() })
Low-level HTTP client that handles base URL construction, auth headers, query params, and error mapping. All resource modules use this.
Behaviour can be extended without subclassing via HttpClient.interceptors (axios/TanStack-style request/response/error hooks). Interceptors can also be supplied at construction time through
config.interceptors.