-
-
Notifications
You must be signed in to change notification settings - Fork 6
Getting Started
This guide walks you through setting up a Stake Engine game from scratch and testing the API using the interactive demo page.
Looking to integrate the package into your own project? See Package Integration instead.
- A Stake Engine account
- Node.js (for local development, optional)
- Sign up at stake-engine.com if you haven't already
- Create a Publisher - This represents your game studio or brand
- Create a New Game - Give it a name and configure basic settings
Math books define the game outcomes and probabilities. You can use the included demo math files or create your own.
- In your game page, click Files > Import Files > Math
- Upload the files from
demo/math/folder:-
base.csv- Human-readable format -
base.json- JSON format -
base.jsonl- JSON Lines format -
base.zst- Compressed format
-
You have two options for the game frontend:
Upload a minimal index.html file as a placeholder:
<!DOCTYPE html>
<html>
<head><title>Game</title></head>
<body><p>Use the API Demo to test this game.</p></body>
</html>Build the interactive demo and upload it as your frontend:
git clone https://github.com/raw-fun-gaming/stake-engine-client.git
cd stake-engine-client
npm install
npm run build:demoThen upload the contents of the docs/ folder via Files > Import Files > Frontend.
- In your game page, click Launch Game
- The game will open in a new window with URL parameters like:
https://your-game.stake-engine.com/?sessionID=xxx&rgs_url=rgs.stake-engine.com&lang=en
If you uploaded a placeholder frontend, use the hosted demo page:
- Copy your game URL (including all parameters)
- Go to raw-fun-gaming.github.io/stake-engine-client
- Paste the URL and click Parse URL
- Click Authenticate to connect
Run the demo locally for development:
npm run demoOpen http://localhost:5173 and paste your game URL.
Once authenticated, you can test all API functions:
| Button | Function | Description |
|---|---|---|
| Get Balance | getBalance |
Check player's current balance |
| Place Bet | play |
Start a new betting round |
| End Round | endRound |
Complete the current round |
| End Event | endEvent |
End a specific game event |
| Force Result | forceResult |
Search for specific outcomes (testing) |
| Replay | replay |
Fetch historical bet data |
- Authenticate - Connect to RGS with session
- Place Bet - Enter amount and mode, click Submit
- End Round - Complete the round to see results and update balance
- Repeat as needed
To test replay functionality:
- Switch to Replay mode in the demo page
- Enter Game ID, Version, Mode, and Event ID
- Click Load Replay to fetch historical data
Or paste a replay URL directly:
https://game.example.com/?replay=true&game=xxx&version=1&mode=base&event=123&rgs_url=rgs.stake-engine.com
Click End Round to finish the current round before placing a new bet.
- Verify your
sessionIDhasn't expired - Check that
rgs_urlis correct - Ensure your game is properly launched on Stake Engine
The RGS server handles CORS. If you see CORS errors, verify:
- You're using the correct
rgs_url - Your game is properly configured on Stake Engine
- API Reference - Detailed API documentation
- TypeScript Types - Type definitions
- Usage Patterns - Real-world examples