Skip to content

Player identity

Every request your game makes carries the player’s game ticket. Spawnle knows who the player is from it, so your game never shows a login screen and never handles passwords.

const { user } = await Spawnle.init();
user.handle; // "sofi_moth" — unique, stable, safe to use as an id
user.displayName; // "Sofi" — what to show; falls back to the handle
user.avatarUrl; // picture URL, or null
user.avatarColor; // "#9b8cff" — background behind the initial when there is no picture
user.level; // the player's Spawnle level
user.studio; // { id, name, title, color } — the studio badge they wear, or null

Over REST: GET /v1/sdk/me.

Use handle to key anything you store about a player on your own servers. Display names can change and are not unique.

A ticket (gt_…) is a random token the launcher gets from the API right before starting your game:

  • It belongs to one player and one game.
  • It lasts 24 hours.
  • It opens only the SDK routes (/v1/sdk/…). It cannot read the player’s messages, friends list, email or library, nor change anything on the account.
  • Changing the account’s password ends it immediately.

The launcher only gives tickets for games in the player’s library (or to the game’s own developer).

A player could send your server any name. To know who is really connected, have the game send its ticket and let your server ask Spawnle — see Server verification.

socket.send(JSON.stringify({ type: "hello", ticket: spawnle.ticket }));