Part 9 of 12 · Production

Integrate RGS sessions, wallet amounts and round recovery

The money boundaries, staging lifecycle and failure scenarios that demos miss.

4 min read · Slotgen Technical Editorial · Checked 6 September 2026

Official fifty-fifty example showing Place Bet, End Round, balance and the JSON play response.
Software screenshot

The official fifty-fifty tutorial displays the returned round beside the wallet controls. This archived documentation screenshot is a teaching example, not a live Slotgen account or proof of a completed integration.

© 2025 Stake Engine · MIT. Resized where needed and converted to WebP; no cropping or retouching.Source: Stake Engine · Getting Started with RGS Responses ↗View full-size image ↗
In this article
  1. In brief
  2. Read the launch context
  3. The round lifecycle
  4. Understand the money boundaries
  5. Apply authentication configuration
  6. Test the failures deliberately
  7. Finish this part
All 12 parts in this series
  1. Start here: the market, originality and a realistic roadmap
  2. Choose your AI assistant and control the budget
  3. Clone the right repositories and set up your workspace
  4. Design slot math: reels, paytables, RTP and mode costs
  5. Simulate, optimize and validate the outcome distribution
  6. Connect math events to a reliable, responsive frontend
  7. Reskin with an original, coherent art direction
  8. Choose animation software and build the export pipeline
  9. Integrate RGS sessions, wallet amounts and round recovery
  10. Work toward three-star quality without false promises
  11. Package the game, upload to staging and request review
  12. Advanced checks and a sustainable solo workflow

In brief

An animated demo is not a wallet-integrated game. The frontend must authenticate a valid session, use the server's allowed configuration, request a round, present its result and finish or recover that round correctly. Test this in staging without hardcoded credentials.

  • Keep payout multipliers, wallet integers and display values separate.
  • Never substitute a local random result for a failed server call.
  • Do not blindly repeat a bet after an ambiguous network failure.

Read the launch context

The official RGS specification describes launch parameters including sessionID, lang, device and rgs_url. The RGS address comes from the launch context rather than a permanently hardcoded production endpoint.

Treat a session URL as sensitive. Do not include it in a public screenshot, analytics payload, bug report or repository. When someone reports a problem, request a redacted reproduction and a non-sensitive build identifier instead.

Keep the SDK's established URL handling unless a reviewed integration requirement calls for a change. Do not trust arbitrary copied URLs as production configuration or disable transport/security checks to make a demo connect.

The round lifecycle

Launch context → authenticate → apply allowed configuration
                           ↓
                 recover active round, if any
                           ↓
                 accept one bet action
                           ↓
              request round → present returned events
                           ↓
                 settle/end as required → ready

This is a conceptual flow, not a replacement API implementation. Account for modes that close automatically and those requiring an explicit completion call; retain the SDK's round-state logic and confirm actual staging behavior.

The pinned request helpers use /wallet/authenticate, /wallet/play, /wallet/end-round and /bet/event. They already convert the bet amount at the request boundary. Passing a value that you have converted a second time can multiply the intended amount incorrectly.

Understand the money boundaries

Wallet amounts use integer units with six decimal places: 1,000,000 units represents one currency unit. This is different from the math book's hundredths-of-a-multiplier convention. Display formatting also varies by currency. The RGS specification defines the wallet representation and mode cost relationship.

For a base bet of 0.20 currency units and a mode costing 100 base bets, the displayed purchase cost is 20.00 currency units. Do not pass the already-multiplied 20.00 into a helper expecting the base bet if the server applies the mode cost. Test the actual helper contract with a known staging example.

Use explicit conversion functions and numeric-range checks. Preserve exact integers where needed; JavaScript numbers cannot safely represent every possible 64-bit integer. Do not solve precision issues by rounding arbitrary server values until they look plausible.

Apply authentication configuration

The reference Authenticate component handles balance, bet levels, jurisdiction settings and a round to resume. A custom interface should preserve those responsibilities.

Do not display a purchase button for a mode that is unavailable, or ignore returned restrictions because the training UI once allowed it. If a jurisdiction disables a feature, both the visible control and the underlying action must respect that setting.

An active round and the last completed round are not interchangeable. After refresh, reconstruct the correct presentation state from the returned round and progress information. Do not invent a fresh bonus just because the previous animation was interrupted.

Test the failures deliberately

Scenario Expected product behavior
Invalid or expired session Clear error; no pretend balance or gameplay
Insufficient balance Explain the failure; no winning animation
Rapid double click At most one valid in-flight bet action
Network loss after request Reconcile server state before another bet
Refresh during bonus Recover the existing round correctly
Tab hidden during sound Resume without duplicate loops or stale overlays

These are engineering test expectations, not a claim that retries are safe on every endpoint. A timeout can happen after the server has accepted an operation. Blindly sending another play request risks creating another bet rather than completing the first one.

When an error is logged, retain its category and a safe diagnostic identifier, not the full session payload. Keep test instrumentation separate from the final bundle.

Finish this part

Produce a staging recording of an ordinary round and a recovered interrupted round. Confirm the balance and final payout against the server response. Only then describe the game as integrated; “it spins locally” is a different milestone.

Independent Slotgen guide. Not affiliated with or endorsed by Stake Engine. Platform rules, prices and repositories can change. A checklist or SDK build does not guarantee approval, a star rating or revenue.