Runtime

NG SDK

A lightweight browser SDK for readiness, progress, scores, saves, and wallet operations inside the platform iframe.

Quick integration

Include the SDK from the sandbox origin, call NG.ready() once your game can be played, and use the async save/load helpers for persistence.

Rendered SDK quick integration snippet with NG.ready, NG.load, NG.score, and NG.save.
The SDK path is a small browser script: report readiness, read saved state, submit scores, and persist player progress.
<!doctype html>
<html>
<head><meta charset="utf-8"><title>My Game</title></head>
<body>
  <canvas id="stage" width="600" height="600"></canvas>
  <script src="https://sandbox.newgame.win/sdk/ng.js"></script>
  <script>
    const high = await NG.load('high_score') || 0
    function onGameOver(score) {
      NG.score(score, { level: 4 })
      if (score > high) NG.save('high_score', score)
    }
    NG.ready()
  </script>
</body>
</html>

Core methods

MethodPurpose
NG.ready()Tell the platform to hide loading UI.
NG.progress(value)Report loading progress from 0 to 1.
NG.score(score, payload?)Submit a score for leaderboards.
NG.save(key, value)Persist JSON data for anonymous or signed-in players.
NG.load(key)Read a saved value or return null.
NG.delete(key)Delete a saved value.
NG.balance / earn / spendUse platform wallet APIs for signed-in players.