11 min read

Identity, profile, run, and claim flows

Use scoped identities and submit replay-resistant results.

Identity and privacy

  1. 1.Player IDs are scoped to one game and environment.
  2. 2.Tokens never expose email or global account IDs.
  3. 3.Use identity.login only after clear player intent.
  4. 4.Profiles may be private and must not be copied into another game.

Run flow

const run = await D3Games.runs.start({ gameVersion: "1.0.0", scoringVersion: "v2" });
await D3Games.runs.submit({ ...run, gameVersion: "1.0.0", scoringVersion: "v2", metrics: { score: 1200 } }, crypto.randomUUID());
A signed browser run proves continuity, not an honest score. Use server-verified submissions for authoritative outcomes.

Guest claim

Keep the pending claim token only in memory or protected session storage. After login, call runs.claim once; rotated or consumed tokens cannot be replayed.