HTTP Adapters
Swap fetch for axios — or any HTTP transport.
The client's HTTP layer is pluggable. Default is fetch; axios ships as an option.
The contract
FetchAdapter (default)
Uses the global fetch — works in all modern browsers, Node 18+, React Native, Cloudflare Workers, Deno, Bun.
JSON request bodies are automatically JSON.stringify-ed; JSON responses are automatically parsed when Content-Type: application/json.
createAxiosAdapter(axiosInstance)
Wraps an axios instance so you keep the rest of your app's HTTP setup (interceptors, retries, baseURL) while letting the auth client share the transport.
Custom adapter
Wrap whatever client you like. As long as you satisfy the contract, the library doesn't care.
Cookie mode and credentials
When the client is in cookie mode, every request goes out with credentials: 'include'. Make sure your CORS config has Access-Control-Allow-Credentials: true and an explicit origin allowlist (* is forbidden with credentials).