OptionalbaseBase URL prepended to every request path.
Defaults to '' (same origin).
OptionalfetchCustom fetch implementation.
Defaults to the global fetch. Useful for testing or server-side
rendering where a polyfill is needed.
Optionalinit: RequestInitOptionalgetReturns the current authentication token, or null if unauthenticated.
When a non-null value is returned it is sent as a Bearer token in
the Authorization header.
OptionalheadersAdditional headers sent with every request.
OptionalhooksLifecycle hooks invoked at various stages of a request.
OptionalmiddlewaresMiddleware functions that wrap the fetch call. Applied in array order — the first middleware is the outermost wrapper.
OptionalonCalled when a 401 Unauthorized response is received.
Typically used to clear stored tokens and redirect to a login page.
OptionalsubscriptionDefault reconnection options for all WebSocket subscriptions created by this client.
Individual subscription calls can override these options by passing a
reconnect argument. Pass reconnect: false at the call site to
disable reconnection for a specific subscription even when a global
default is set.
Configuration for createClient.