Skip to content

GymClientOptions

optional baseUrl?: string

API origin, e.g. https://gymgym.club. Omit in the browser to use the current origin.


optional fetch?: (input, init?) => Promise<Response>

Custom fetch (tests, React Native, service bindings).

MDN Reference

RequestInfo | URL

RequestInit

Promise<Response>


optional headers?: Record<string, string>

Extra headers on every API request.


optional onMutation?: (operationName) => void

Called after every successful mutation, e.g. to invalidate caches.

string

void


optional storage?: QueueStorage

Where the offline queue persists; defaults to memory.


optional token?: string | (() => string | null | undefined)

Bearer token for clients without cookies (CLI, native apps). Read on every request.