Riz Games SDK · v0.1

One player identity. Any web stack.

Connect a Next.js, Svelte, Phaser, Unity WebGL, Godot or plain JavaScript game to verified sessions, analytics, rankings and RP.

Get a game key

Framework-free

A tiny browser script and postMessage bridge.

Server trusted

Riz calculates rewards; games report events.

01

Quick start

Register the deployed URL in Creator Studio, request Riz Connected mode, then copy the public game key.

Load the SDK
<script src="https://your-riz-domain.com/riz-games-sdk.js"></script>
Connect a run
const riz = await RizGames.initialize({
  gameKey: "riz_game_your_public_key"
});

await RizGames.game.start();

// Report progress; Riz decides rewards server-side.
await RizGames.score.submit(2400);
await RizGames.level.complete("level-1", { time: 42 });
await RizGames.analytics.tutorial.complete("onboarding");
await RizGames.analytics.track("shop_opened", { source: "lobby" });

const result = await RizGames.game.end(2400);
console.log(result.rpEarned);

The game key is public

Browser code cannot keep secrets. Your key identifies the game; Riz creates a short-lived run token only when the player launches from the verified Riz page.

02

How it works

The SDK communicates with the Riz play wrapper instead of asking creators to handle player cookies or expose server credentials.

01

Launch

Player opens the game from its Riz page.

02

Session

Riz creates a short-lived signed run.

03

Events

The game reports approved gameplay events.

04

Reward

Riz validates and calculates score and RP.

03

Supported events

Only documented event names are accepted. Extra metadata can support analytics, but it never directly grants RP.

game_started

A real run has begun.

level_started

The player entered a level or round.

level_completed

A level ended successfully.

score_submitted

Updates the highest score in this run.

achievement_unlocked

Reports an achievement candidate.

game_paused

The active run was paused.

session_heartbeat

Automatically measures active in-game time.

tutorial_started / completed

Measures onboarding progression and completion.

checkpoint_reached

Records meaningful progression points.

item_collected / powerup_used

Measures feature and content usage.

custom_event

Records a creator-defined analytics event and metadata.

game_ended

Finalizes the run and any eligible RP.

04

Security and fair rewards

Integration verification is required before real rankings or RP are enabled.

The deployed origin must match the URL registered in Studio.
Scores are capped and only the strongest score in a run is kept.
Sessions expire and accept a limited number of events.
RP is calculated by Riz with per-run limits.
A completed run cannot be rewarded twice.
Riz may request extra telemetry for competitive games.

05

Testing and going live

A connected submission begins in SDK Testing mode. Creator test sessions work, but they award no RP.

  1. 1Submit the deployed game URL and select Riz Connected.
  2. 2Copy the generated public game key into the build.
  3. 3Launch the creator preview from Studio and verify events.
  4. 4Riz reviews gameplay, origin, score rules and performance.
  5. 5After approval, the Connected badge, rankings and RP become live.