Integration Guide

Everything your dev team needs to add NextGen Instant Games to a sweepstakes platform. The games are hosted by NextGenDev.Games — you only integrate two things: a launch call and a seamless wallet.

Overview

  1. Your server calls POST /api/v1/launch with the player and game. You get back a one-time game URL.
  2. You open that URL in an iframe (or new tab) for the player.
  3. While the player plays, our server calls your wallet endpoints to check balance, debit bets and credit wins. Your wallet stays the single source of truth.

You will receive from NextGenDev.Games: an Operator ID (e.g. op_yourbrand), an API secret, and the base URL of the game server. Amounts are always integers in minor units (cents): 1250 = 12.50.

Gold Coins & Sweeps Coins

Both are supported on the same operator account. Pass "currency": "GC" or "currency": "SC" when you launch a game; if you leave it out, your account’s default currency is used. The currency is sent back to you on every wallet call, so your wallet debits and credits the right balance.

Request signing (both directions)

Every request is signed with HMAC-SHA256 using your API secret. The same scheme is used for your calls to us and our calls to your wallet.

X-NGG-TimestampUnix time in seconds. Requests older than 5 minutes are rejected.
X-NGG-Signaturehex( HMAC_SHA256( secret, ${timestamp}.${rawBody} ) )
X-Operator-IdYour operator ID (only on requests you send to us)
// Node.js
import crypto from "node:crypto";
function sign(secret, rawBody) {
  const ts = Math.floor(Date.now() / 1000).toString();
  const sig = crypto.createHmac("sha256", secret).update(`${ts}.${rawBody}`).digest("hex");
  return { "X-NGG-Timestamp": ts, "X-NGG-Signature": sig };
}
// Verify (on your wallet endpoints): recompute and compare with crypto.timingSafeEqual, check timestamp is within 300s.

1. Launch a game

POST {GAME_SERVER}/api/v1/launch

{
  "player_id": "12345",          // your player's unique ID (string)
  "game_id": "plinko",           // see Game IDs
  "mode": "real",                // "real" uses your wallet, "demo" uses free play credits
  "currency": "SC",              // optional: "SC" (Sweeps Coins) or "GC" (Gold Coins); defaults to your account currency
  "return_url": "https://yourbrand.com/lobby"    // optional: shows a "Lobby" button in the game
}

Response:

{ "token": "9f1c…", "url": "https://{GAME_SERVER}/play/plinko?token=9f1c…", "expires_in": 14400 }
// Node.js example
const body = JSON.stringify({ player_id: user.id, game_id: "mines", mode: "real" });
const res = await fetch(GAME_SERVER + "/api/v1/launch", {
  method: "POST",
  headers: { "content-type": "application/json", "X-Operator-Id": OPERATOR_ID, ...sign(API_SECRET, body) },
  body,
});
const { url } = await res.json();   // -> put this in the iframe

Never call launch from the browser — the API secret must stay on your server.

2. Embed the game

<iframe src="{url}" style="width:100%;height:100%;border:0" allow="autoplay; fullscreen"></iframe>

The games are responsive (desktop and mobile). Sessions last 4 hours; request a new URL each time a player opens a game.

3. Wallet callbacks (you implement these)

Our server sends signed POST requests with JSON bodies to {your wallet_url}/balance, /debit, /credit and /rollback. Respond within 8 seconds with HTTP 200 and { "balance": <integer minor units> }.

EndpointWhenBody fields
/balanceGame opensoperator_id, player_id, currency
/debitPlayer places a bet+ transaction_id, round_id, amount, game_id
/creditRound finishes (sent even when amount = 0, so you can close the round)+ transaction_id, round_id, amount, game_id
/rollbackA debit could not be confirmed (timeout / 5xx)+ transaction_id, reference_transaction_id (the debit), round_id, amount
// Example debit request we send you
POST https://yourbrand.com/ngg-wallet/debit
X-NGG-Timestamp: 1791700000
X-NGG-Signature: 5c0f…
{ "operator_id": "op_yourbrand", "player_id": "12345", "currency": "SC",
  "transaction_id": "3b0d…:debit", "round_id": "3b0d…", "amount": 100, "game_id": "plinko" }

// Your success response
{ "balance": 48900 }

// Your error response (HTTP 4xx)
{ "error": "INSUFFICIENT_FUNDS" }

Rules your wallet must follow

Round lookup (for support & reconciliation)

POST /api/v1/rounds (signed) with { "round_id": "…" } or { "player_id": "12345", "limit": 50 }. Returns bet, payout, multiplier, status, the full outcome and provably-fair nonce for each round.

Games, RTP & limits

game_idNameTypeRTPTop multiplier
plinkoPlinko NovaInstant result96%1,000×
minesGem MinesMulti-step (cash out)96%4,992,288×*
kenoCosmic KenoInstant result96%5,250×
diceNeon DiceInstant result96%48×
limboLimbo RushInstant result96%1,000,000×*
crashRocket RushMulti-step (cash out)96%1,000,000×*
scratchScratch RoyaleInstant result96%1,000×
hiloRoyal Hi-LoMulti-step (cash out)96%Unlimited streak*
towerSky TempleMulti-step (cash out)96%251,658×*
lampLamp of FortunesInstant result96%250× + 3 jackpots

* Theoretical maximum. Every payout is capped by your max win per round.

Default RTP96% on every game. Configurable from 80% to 99.5% per operator and per game.
Default min bet0.10 per round (10 minor units)
Default max bet500.00 per round (50,000 minor units)
Default max win100,000.00 per round (10,000,000 minor units)

All limits are set per operator and can be overridden per game. The current values are shown to players in each game’s Quick Rules.

Max win cap

Every round’s payout is limited to your operator’s max win per round, enforced on the game server before we credit your wallet. Games with very high theoretical multipliers (Rocket Rush, Limbo, Gem Mines, Sky Temple, Hi-Lo streaks) can never pay more than this cap, so one lucky round can’t wipe out a balance. Tell us the cap you want for GC and SC and we set it on your account.

Lamp of Fortunes jackpots

TierStarts at (seed)Grows byOdds per play*
Mini20.000.6% of each Lamp bet1 in 400
Major250.000.5% of each Lamp bet1 in 4,000
Grand5,000.000.4% of each Lamp bet1 in 60,000

Provably fair

Every result comes from HMAC-SHA256 of a server seed (committed by its hash before play) and the player’s client seed and nonce. Players can rotate seeds in any game and check past rounds on the public round verifier, which is a good trust signal you can link to from your own site.

Error codes

BAD_SIGNATURE / UNKNOWN_OPERATORCheck operator ID, secret and server clock.
GAME_DISABLEDGame not enabled for your operator.
MISSING_PLAYER_IDplayer_id is required.
INSUFFICIENT_FUNDSYour wallet rejected the debit.
WALLET_UNREACHABLE / WALLET_HTTP_5xxYour wallet timed out or errored; the bet was rolled back.

Go-live checklist

  1. Launch works with mode: "demo" (no wallet needed).
  2. Wallet endpoints verify signatures and are idempotent.
  3. Test: bet → win, bet → lose, insufficient funds, duplicate transaction_id, rollback.
  4. Reconcile a day of rounds with /api/v1/rounds.
  5. Send your wallet URL to NextGenDev.Games to switch to real mode.

Questions: support@nextgendev.games · NEXTGENGAMES LLC