Skip to main content
You generate the token. You validate it. You decide when it dies. Zero-Dash only carries it: from the launch URL, back to your Player authorization callback, and into every debit for that session.

Requirements

Unique and non-deterministic

A random, unguessable value. Never the player ID, the account ID, an email, or anything derived from them.

At least 2 hours valid

Sliding-window expiry is preferred where your platform supports it — the token refreshes while the player is active.

Reusable for the whole session

Multiple API calls and client reloads use the same token. Single-use tokens break every reconnect.

No length limit

Any length is fine. An opaque random string or a signed JWT both work.
The token travels as a query parameter in the launch URL. Assume it will be visible in browser history, in a shared screenshot and possibly in an intermediate access log. That is exactly why it must be non-deterministic, scoped to one player, time-limited and revocable.

Choosing a format

A random identifier, with the session state in your store. Simple and instantly revocable.
Revoking is a single delete. Preferred when you already run a session store.

Validating it

Your /player callback receives the token and answers with the player’s identity:
Reject the request when the token is unknown, expired, revoked, or belongs to a different player than the one the request implies. A rejected authorization stops the game from starting — which is the correct outcome.
Token validity and accountId are separate concerns. The token identifies a session; the accountId identifies the player, for life. See Account ID.

Lifetime in practice

This is the one that catches people: /credit and /rollback carry no token at all and can arrive days after the round. Never gate them on session validity. See Errors and retries.

Common mistakes

It is deterministic and permanent. Anyone who learns a player ID can open a session as that player, forever. Use random bytes.
The game reloads on reconnect, on rotation, on a resumed session. A token consumed by the first /player call breaks the second one.
A 15-minute token ends the round for anyone who steps away. Two hours is the floor; sliding expiry is better.
An account ID maps to exactly one currency. If a player holds several wallets, each needs its own session with its own token and its own account ID.