Usage

After setup, the SDK is ready to use. Here's the core workflow:

Points Flow

// 1. Add points during gameplay (accumulated locally, flushed incrementally)
sdk.addPoints(10);

// 2. End the game and save points (commits all accumulated points)
await sdk.endGame();

Important:

  • endGame() takes no parameters. It saves all points accumulated via addPoints(). savePoints() is an alias for endGame().

  • This method opens a gameplay-blocking modal that shows a loading screen, then either a success screen (with a points boost prompt) or an error screen. The game should treat this as an "end of round" action — do not call it during active gameplay, as the modal will overlay and interrupt the player's session.

  • If the player isn't logged in, the SDK automatically triggers a login modal first, then saves after authentication completes.

  • Rate-limited to once every 5 seconds.

Reading Points

const { points, activeMultiplier } = await sdk.getPoints();
console.log(`Today's points: ${points}, multiplier: ${activeMultiplier}x`);

Rewards

UI Controls

Events

See the full SDK reference for all available methods and events.

Last updated