Beta. The generated types and transport are stable to use; the ergonomic layer
is hardening during the rollout window. Pin an exact version in production and
review the versioning policy.
Install
Initialize
The SDK is constructed withinitialize({ token, environment, ... }). The
token is a short-lived member token your backend obtained from
POST /v1/auth/exchange - never your Org-API-Key.
refreshToken hook and the SDK refreshes the member token
automatically near expiry and once on a 401. The hook must call your
backend (which re-exchanges the Org-API-Key) and return
{ accessToken, expiresAt? }. See Authentication for the full
contract.
Configuration
initialize accepts the shared configuration vocabulary - baseUrl,
maxRetries, timeoutMs, a custom fetch, and more. Here it is alongside the
Swift and Kotlin equivalents:
Errors
Every failed request throws a typed error carrying the stable envelopecode.
Branch on the class, then refine with the code:
ApiError (base for HTTP errors) and UnauthorizedError,
ForbiddenError, NotFoundError, ConflictError, ValidationError,
RateLimitError, ServerError, plus NetworkError / TimeoutError and the
common base ExpysError. Treat an unknown code as the generic class for its
status - new codes can appear in a minor release. See Errors.
Runtime support
Works anywhere a standardfetch exists: modern browsers (Vite / web), Expo /
React Native, and Node 18+. Provide a fetch polyfill for older runtimes; the
built package is smoke-tested on Node 18 / 20 / 22, Bun, and Deno. The SDK sends
no telemetry.
Next steps
Authentication
Minting member tokens and the refresh hook.
Configuration
Every option with its default.
Errors
The error taxonomy and stable codes.
API reference
Every endpoint, with a live “Try it” playground.