Skip to main content
Every SDK hook surfaces errors as ApiError. Each ApiError carries three fields:
  • code — the API’s stable machine-readable identifier (e.g. refresh_invalid). May be undefined if the response body was missing or malformed.
  • status — the HTTP status code (e.g. 401, 404).
  • message — human-readable, may reword.
Branch on code for recovery logic; show message in toasts / banners; use status for catch-all 4xx-vs-5xx checks.

Import

Usage

app/page.tsx

Error codes

The codes below are stable across SDK minor versions. Catch-all on status for codes not listed (rare; the API tries to emit a stable code on every 4xx).

Session

Wallet

Retry behaviour

The SDK’s hooks retry 5xx and network errors up to 3 times with react-query’s default backoff. 4xx is treated as terminal — codes like invalid_wallet or validation_error describe a fixed state, not a transient failure, so retrying just spams the console and the server.