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.

<!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
| Method | Purpose |
|---|---|
| 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 / spend | Use platform wallet APIs for signed-in players. |