Getting started
Auth in Real Games
Recommended token flow for production.
Auth in Real Games
Players should never call admin/control endpoints directly from client apps.
Recommended Flow
- Player authenticates against your game backend.
- Backend validates identity/session.
- Backend mints short-lived Nexis token using control API.
- Client connects to Nexis data plane with that token.
Why this architecture is required
- Keeps project secrets and key lifecycle off the client.
- Lets you enforce your own access policy before gameplay connect.
- Supports refresh/reissue and revocation strategies.
Token claims
Nexis token payload includes:
project_idissued_atexpires_at
Optional fields (if you use them in your backend flow):
key_idaud
Auth modes in Nexis runtime
required: token must be valid.optional: token accepted when present; anonymous allowed.disabled: skip auth checks entirely.
Use required in production.
optional and disabled are mainly for local development and testing.
Backend mint example
curl -X POST http://localhost:3000/tokens \
-H "content-type: application/json" \
-d '{"project_id":"<project-id>","key_id":"<key-id>","ttl_seconds":900}'Typed Token Claims
const : = {
: 'demo-project',
: new ().(),
: new (.() + 15 * 60 * 1000).(),
: 'demo-key',
};