Embed Widgets
Embed interactive roulette widgets on any website with a single iframe tag. Choose between the full Roulette Widget (wheel + board + stats) or the compact Board Widget (board only). Both share the same URL parameter API.
/embed/board— Compact board-only view. Same as roulette with wheel, chips, stats, and settings disabled by default. Add
enableSimulation to enable click-to-simulate.Quick Start
Roulette Widget
Full roulette experience with wheel, stats, and interactive play:
<iframe
src="https://spinstrategy.app/embed/roulette?bets=RED-5,17-1"
style="border:none;width:100%;height:700px"
></iframe>Board Widget
Compact board-only view (no wheel, no chips, no stats):
<iframe
src="https://spinstrategy.app/embed/board?bets=RED-5,17-1"
style="border:none;width:100%;height:600px"
></iframe>Query Parameters
Both widgets accept the same URL parameters. The board widget overrides some defaults (see table).
| Parameter | Type | Roulette Default | Board Default | Description |
|---|---|---|---|---|
| bets | string | (none) | (none) | Comma-separated bet tokens (see format below) |
| enableSimulation | flag | off | off | Enable click-to-simulate mode |
| theme | string | dark | dark | dark or light |
| disableWheel | flag | off | on | Hide the spinning wheel and right panel |
| disableHistory | flag | off | off (on without enableSimulation) | Hide the history bar |
| disableOutcomeBoard | flag | off | off (on without enableSimulation) | Hide the outcome heatmap above the board |
| disableStats | flag | off | on | Hide the stats panel |
| disableChips | flag | off | on | Hide the chip selector |
| disableSettings | flag | off | on | Hide the settings gear |
?enableSimulation&disableWheel enables simulation and hides the wheel. Settings controlled by URL parameters are locked in the settings dialog.Bet Token Format
Each bet is a token in SELECTION-BETSIZEformat, separated by commas. The bet size is in dollars ($0.01 – $10,000).
Straight Bets
Use the pocket number directly:
| Token | Meaning |
|---|---|
| 17-1 | STRAIGHT on 17, $1 |
| 0-2 | STRAIGHT on 0, $2 |
Named Bets
Use the bet type name, optionally followed by a selection number:
| Token | Meaning |
|---|---|
| RED-5 | RED, $5 |
| BLACK-5 | BLACK, $5 |
| EVEN-2 | EVEN, $2 |
| ODD-2 | ODD, $2 |
| LOW-3 | LOW (1-18), $3 |
| HIGH-3 | HIGH (19-36), $3 |
| CORNER8-3 | CORNER at 8, $3 |
| SPLIT_LEFT5-2 | SPLIT LEFT at 5, $2 |
| SPLIT_TOP5-2 | SPLIT TOP at 5, $2 |
| STREET7-1 | STREET 7, $1 |
| DOUBLE_STREET3-1 | DOUBLE STREET 3, $1 |
Grouped Bets (1-Based Index)
DOZEN, COLUMN, STREET, and DOUBLE_STREET use 1-based indices in the URL:
| Token | Meaning |
|---|---|
| DOZEN1-10 | 1st dozen (1-12), $10 |
| DOZEN2-10 | 2nd dozen (13-24), $10 |
| DOZEN3-10 | 3rd dozen (25-36), $10 |
| COLUMN1-5 | 1st column, $5 |
| COLUMN2-5 | 2nd column, $5 |
| COLUMN3-5 | 3rd column, $5 |
All Supported Bet Types
RED, BLACK, EVEN, ODD, LOW, HIGH, DOZEN, COLUMN, STREET, DOUBLE_STREET, CORNER, SPLIT_LEFT, SPLIT_TOPSimulation Mode
Add enableSimulation to enable click-to-simulate. Users can click any number on the board or outcome heatmap to simulate that pocket hitting. The widget tracks W/L stats, balance, and round history with full branching support (navigate to a past round and click to create an alternate timeline).
<iframe
src="https://spinstrategy.app/embed/roulette?bets=RED-5,17-1&enableSimulation"
style="border:none;width:100%;height:700px"
></iframe>postMessage API
The widget communicates with its parent frame via window.postMessage. Listen for messages on the parent window to react to resize and round events.
Resize Event
Emitted whenever the widget's content size changes. Useful for auto-sizing the iframe.
{
type: "spinstrategy:resize",
payload: { width: number, height: number }
}Round Result Event
Emitted after every finalized spin or simulation click with the outcome details.
{
type: "spinstrategy:roundResult",
payload: {
pocket: number, // 0-36, the winning pocket
won: boolean, // whether any bet won
net: number, // net result in dollars (can be negative)
totalRounds: number // cumulative rounds played
}
}Listener Example
window.addEventListener("message", (event) => {
if (event.data?.type === "spinstrategy:roundResult") {
const { pocket, won, net, totalRounds } = event.data.payload;
console.log(`Round ${totalRounds}: pocket ${pocket}, ${won ? "WIN" : "LOSS"}, net $${net}`);
}
if (event.data?.type === "spinstrategy:resize") {
const iframe = document.getElementById("my-roulette");
if (iframe) iframe.style.height = event.data.payload.height + "px";
}
});event.origin === "https://spinstrategy.app" before trusting message payloads.Responsive Behavior
The roulette widget switches between horizontal (board + wheel side-by-side) and stacked (vertical) layout based on the container width. Above 860px, the wheel panel sits beside the board. Below 860px, it stacks vertically. Below 540px, the content scales proportionally to fit.
height:700px for the roulette widget and height:600pxfor the board widget. With simulation enabled, the history bar adds height — consider height:700px for the board too.Examples
Shared Strategy Embed
Embed a shared strategy's board with full progression-aware simulation. The widget loads the strategy's bets and progression config automatically — no manual bet tokens needed.
<iframe
src="https://spinstrategy.app/embed/board/s/YOUR_SHARE_TOKEN?enableSimulation"
style="border:none;width:100%;height:800px"
></iframe>The share token comes from the strategy sharing feature. When a user shares a strategy, they get a URL like /s/abc123— use that token in the embed URL.
Shared Strategy Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| enableSimulation | flag | on | Enable progression-aware simulation (defaults to on) |
| hideStats | flag | off | Hide the stats panel (compact mode with reset button) |
strategyProgressionStepToTrigger and bet amounts update as the progression advances.