Skip to main content
Authentication exchanges player credentials for a backend session. The SDK stores and rotates the tokens for you — your game never reads or verifies JWT signatures. The backend is the identity owner.

Login

Browser:
Under the hood this calls POST /api/v1/user/login and returns:

Token lifetime

Token lifetime is derived from the backend expiresIn value and, when present, from JWT exp claims with clock-skew grace. The refresh-token fallback lifetime is 7 days when the backend omits expiry and the token is not a decodable JWT.

Refresh

The SDK refreshes automatically near expiry. Manual rotation:

Logout

Revokes the server session (POST /api/v1/user/s/logout, body { "device_id": ... }) and clears local credentials.

Device metadata

Login requests can carry device context through [auth defaults]:
device_id is also sent as the x-device-id header on login.

Security notes

Never log tokens, passwords, or PINs.
  • Treat SessionNotAuthenticated as “re-authenticate” — never fall back to unauthenticated privileged calls.
  • The SDK supports identifier+password credentials today; OTP-based verification is surfaced as an error until supported client-side.
Next: Sessions.
Last modified on September 10, 2026