Types reference
All SDK types are defined and exported from the @rollerz/types package — it's the single source of truth for everything the SDK returns or accepts across all providers. @rollerz/sdk depends on it directly, so installing the SDK for IntelliSense is enough:
npm install @rollerz/sdk --save-devIf you want to reference named types in your own game code (e.g. Go3BetResult, StepperBetType, Currency), import them from @rollerz/types:
import type { Go3BetResult, StepperBetType, Currency } from '@rollerz/types';TIP
For IntelliSense to work in VS Code, make sure your jsconfig.json / tsconfig.json (if you have one) lists "@rollerz/sdk" in compilerOptions.types. See the IntelliSense notes in Getting Started for the full rundown.
Core
InitOptions
Options passed to sdk.init().
| Field | Type | Example | Description |
|---|---|---|---|
platformEvents | Record<string, (data?) => void> | { mute: ({ muted }) => {} } | Callbacks for platform events — dispatched by data.type, invoked with the full flat message object |
enableLogging | boolean | true | Enable SDK console logging |
The parent-origin allowlist is build-time only (set via PLATFORM_ORIGINS env var) and is intentionally not exposed on InitOptions.
Currency
Used throughout the SDK for formatting monetary values.
| Field | Type | Example | Description |
|---|---|---|---|
code | string | 'USD' | Currency code |
prefix | string | '$' | Symbol before the amount |
suffix | string | '' | Symbol after the amount |
grouping | string | ',' | Thousands separator |
decimal | string | '.' | Decimal separator |
precision | number | 2 | Decimal places |
denomination | number | 100 | Smallest unit denominator (e.g. 100 for cents) |
User
Payload returned by sdk.getUser() (and by the SDK server at POST /api/user). Amounts use the same smallest-unit convention as the rest of the SDK (e.g. cents).
import type { User } from '@rollerz/types';| Field | Type | Description |
|---|---|---|
balance | number | Current balance |
currency | Currency | Formatting metadata from the RGS |
sessionId | string (optional) | Session identifier when present |
playerAlias | string (optional) | Display name from the RGS (playerAlias) |
seconds | number (optional) | Session length in seconds (from GDK session) |
rounds | number (optional) | Rounds played in the session |
winLoss | number (optional) | Session win/loss in smallest currency units |
ReelsoftSessionFields
Optional fields merged from RGS responses into server-side provider session objects in TypeScript (Go3Session, GP / Stepper / Rippin Rumble sessions extend this). Games normally consume the shape via getUser() / User instead of reading these off the client session object.
| Field | Type | Description |
|---|---|---|
playerAlias | string (optional) | Same semantics as on User |
seconds | number (optional) | Same as on User |
rounds | number (optional) | Same as on User |
winLoss | number (optional) | Same as on User |
GO3
Go3Session
Returned by sdk.go3.openGame().
| Field | Type | Example | Description |
|---|---|---|---|
sessionId | string | 'ses_xyz789' | Session ID |
requestCounter | number | 0 | Request counter |
balance | number | 10000 | Current balance (in smallest unit) |
currency | Currency | { code: 'USD', prefix: '$', ... } | Currency formatting info |
chipLevels | number[] | [100, 200, 500, 1000] | Available bet amounts |
minBet | number | 100 | Minimum bet |
maxBet | number | 5000 | Maximum bet |
defaultBet | number | 200 | Default bet amount |
boostedMultiple | number | 2 | Multiplier applied to boosted bets |
Go3BetResult
Returned by sdk.go3.placeBet().
| Field | Type | Example | Description |
|---|---|---|---|
roundId | string | 'rnd_abc123' | Round ID (pass to collect()) |
balance | number | 9800 | Balance after bet |
totalBetAmount | number | 200 | Total amount bet |
totalWinAmount | number | 600 | Total amount won |
count | number | 2 | Items hit (0–3) |
multiplier | number | 3 | Win multiplier |
hasBonus | boolean | true | Whether a bonus was found |
nextAction | string[] | ['collect'] | Valid next actions |
Go3BetType
Union of the bet types Go3 supports. Passed as opts.betType to sdk.go3.placeBet() and sdk.go3.getValidBets().
type Go3BetType = 'BASE' | 'BOOSTED';Paired constants:
| Constant | Value | Description |
|---|---|---|
GO3_BET_TYPES | readonly ['BASE', 'BOOSTED'] | Full ordered list — use with createBetSelector({ betTypes: GO3_BET_TYPES }) |
GO3_DEFAULT_BET_TYPE | 'BASE' | The bet type placeBet falls through to when no opts are passed |
GO3_BOOSTED_BET_TYPE | 'BOOSTED' | The bet type the legacy { boosted: true } sugar resolves to |
Stepper
StepperSession
Returned by sdk.stepper.openGame().
| Field | Type | Example | Description |
|---|---|---|---|
sessionId | string | 'ses_xyz789' | Session ID |
requestCounter | number | 0 | Request counter |
balance | number | 10000 | Current balance (in smallest unit) |
currency | Currency | { code: 'USD', prefix: '$', ... } | Currency formatting info |
chipLevels | number[] | [5, 10, 25, 50] | Available bet amounts |
minBet | number | 5 | Minimum bet |
maxBet | number | 500 | Maximum bet |
defaultBet | number | 10 | Default bet amount |
StepperBetResult
Returned by sdk.stepper.placeBet() and sdk.stepper.step().
| Field | Type | Example | Description |
|---|---|---|---|
roundId | string | 'rnd_def456' | Round ID (pass to step() or collect()) |
balance | number | 9990 | Balance after action |
totalBetAmount | number | 10 | Total amount bet |
totalWinAmount | number | 25 | Total win (0 if crashed, payout if cashed out) |
difficulty | string | 'MEDIUM' | Difficulty level |
currentStep | number | 3 | Current step number (0 after placeBet) |
currentPayout | number | 2.80 | Payout if the player cashes out now |
steps | StepperStep[] | See below | Full step ladder with outcomes |
roundEnded | boolean | false | Whether the round has ended |
nextAction | string[] | ['CONTINUE', 'CASH_OUT'] | Valid next actions |
StepperStep
Individual step in the ladder.
| Field | Type | Example | Description |
|---|---|---|---|
step | number | 1 | Step number (1-based) |
payout | number | 2.20 | Payout at this step |
outcome | string | 'SAFE' | 'UNDECIDED', 'SAFE', 'CRASH', or 'CASH_OUT' |
StepperBetType
Union of the difficulty levels Stepper supports. Each level is a separate math model on the RGS — see the difficulty cheat sheet in the API reference for step counts and max multipliers.
type StepperBetType = 'BEGINNER' | 'EASY' | 'MEDIUM' | 'HARD' | 'INSANE';Paired constants:
| Constant | Value | Description |
|---|---|---|
STEPPER_BET_TYPES | readonly ['BEGINNER', 'EASY', 'MEDIUM', 'HARD', 'INSANE'] | Full ordered list |
STEPPER_DEFAULT_BET_TYPE | 'MEDIUM' | The bet type placeBet falls through to when no opts are passed |
Stepper does not support the legacy { boosted: true } sugar — pass betType explicitly to pick a non-default difficulty.
GP (General Purpose)
GPOpenOptions
Options passed to sdk.gp.openGame().
| Field | Type | Example | Description |
|---|---|---|---|
serverUrl | string | 'https://math.example.com/mock' | URL of the math server (required) |
internalClientCode | string | 'go3' | Game type identifier used by the math server (required) |
path | string | '/gameevent/v2' | Custom endpoint path — overrides the default /gameevent |
GPSession
Returned by sdk.gp.openGame().
| Field | Type | Example | Description |
|---|---|---|---|
sessionId | string | 'ses_xyz789' | Session ID |
requestCounter | number | 0 | Request counter |
balance | number | 10000 | Current balance (in smallest unit) |
currency | Currency | { code: 'USD', prefix: '$', ... } | Currency formatting info |
chipLevels | number[] | [100, 200, 500, 1000] | Available bet amounts |
minBet | number | 100 | Minimum bet |
maxBet | number | 5000 | Maximum bet |
defaultBet | number | 200 | Default bet amount |
serverUrl | string | 'https://math.example.com/mock' | Echoed from request |
path | string | '/gameevent' | Echoed from request (if provided) |
GPBetResult
Returned by sdk.gp.placeBet().
| Field | Type | Example | Description |
|---|---|---|---|
roundId | string | 'rnd_abc123' | Round ID (pass to collect()) |
balance | number | 9800 | Balance after bet |
totalBetAmount | number | 200 | Total amount bet |
totalWinAmount | number | 600 | Total amount won |
nextAction | string[] | ['collect'] | Valid next actions |
math | Record<string, unknown> | { details: { rocksCrushed: 2 } } | Raw math server response (structure varies by server) |
The math payload preserves the math server's wire field names verbatim — a GO3-compatible math server still sends rocksCrushed here, even though the native Go3BetResult surface renames it to count. The rename happens in sdk-server for the native GO3 route; GP is a pure pass-through.
GP bet types
GP intentionally exports no bet type union or constants — the set of bet types a GP session understands is decided at runtime by the hosting app. Register them via sdk.gp.configureBetTypes([...]) (see the API reference). When called, betType is typed as string throughout the GP API.
Rippin Rumble
RippinRumbleSession
Returned by sdk.rippinrumble.openGame().
| Field | Type | Example | Description |
|---|---|---|---|
sessionId | string | 'ses_xyz789' | Session ID |
requestCounter | number | 0 | Request counter |
balance | number | 10000 | Current balance (in smallest unit) |
currency | Currency | { code: 'USD', prefix: '$', ... } | Currency formatting info |
chipLevels | number[] | [100, 200, 500, 1000] | Available bet amounts |
minBet | number | 100 | Minimum bet |
maxBet | number | 5000 | Maximum bet |
defaultBet | number | 200 | Default bet amount |
boostedMultiplier | number | 2 | Multiplier applied to boosted bets |
baseBundleMultiplier | number | 10 | Multiplier applied to base-bundle bets |
RippinRumbleBetResult
Returned by sdk.rippinrumble.placeBet().
| Field | Type | Example | Description |
|---|---|---|---|
roundId | string | 'rnd_ghi789' | Round ID (pass to collect()) |
balance | number | 9800 | Balance after bet |
totalBetAmount | number | 200 | Total amount bet |
totalWinAmount | number | 450 | Total amount won |
nextAction | string[] | ['collect'] | Valid next actions |
cardPacks | CardPack[] | (see below) | 1 pack for BASE/BOOSTED, 11 for BASE_BUNDLE |
storage | Record<string, string> | {} | Persistent game state |
Card
| Field | Type | Example | Description |
|---|---|---|---|
rarity | CardRarity | 'RARE' | One of COMMON / UNCOMMON / RARE / LEGENDARY |
id | number | 3 | Card identifier (unique within rarity) |
name | string | 'R03' | Unique card name |
CardPackRaritySummary
| Field | Type | Example | Description |
|---|---|---|---|
count | number | 4 | Cards of this rarity in the pack |
valuePerCard | number | 100 | Base value per card (cents) |
multiplier | number | 10 | Multiplier determined by count |
totalValue | number | 4000 | count * valuePerCard * multiplier |
CardPack
| Field | Type | Description |
|---|---|---|
cards | Card[] | 5 cards in the pack |
common | CardPackRaritySummary | Summary for COMMON tier |
uncommon | CardPackRaritySummary | Summary for UNCOMMON tier |
rare | CardPackRaritySummary | Summary for RARE tier |
legendary | CardPackRaritySummary | Summary for LEGENDARY tier |
totalPayout | number | Sum of the four totalValues |
RippinRumbleBetType
Union of the bet types Rippin Rumble supports. Passed as opts.betType to sdk.rippinrumble.placeBet() and sdk.rippinrumble.getValidBets().
type RippinRumbleBetType = 'BASE' | 'BOOSTED' | 'BASE_BUNDLE';Paired constants:
| Constant | Value | Description |
|---|---|---|
RIPPINRUMBLE_BET_TYPES | readonly ['BASE', 'BOOSTED', 'BASE_BUNDLE'] | Full ordered list |
RIPPINRUMBLE_DEFAULT_BET_TYPE | 'BASE' | The bet type placeBet falls through to when no opts are passed |
RIPPINRUMBLE_BOOSTED_BET_TYPE | 'BOOSTED' | The bet type the legacy { boosted: true } sugar resolves to |
RIPPINRUMBLE_BASE_BUNDLE_BET_TYPE | 'BASE_BUNDLE' | The bet type for bundle buys (11 packs per round) |
Dev
DevControl
Union type for dev panel controls. Created via the devControl helper from @rollerz/types.
| Type | Fields | Description |
|---|---|---|
radio | key, label, options: string[] | Single-select radio buttons |
slider | key, label, min, max, step? | Numeric slider |
checkbox | key, label | Boolean toggle |
text | key, label, placeholder? | Free-text input |
multiselect | key, label, options: string[] | Multi-select checkboxes |
import { devControl } from '@rollerz/types';
devControl.radio('size', 'Size', ['small', 'medium', 'large']);
devControl.slider('speed', 'Speed', 1, 10, 0.5);
devControl.checkbox('debug', 'Debug Mode');
devControl.multiselect('tags', 'Tags', ['a', 'b', 'c']);DevProviderConfig
Defines a provider's dev mode behavior.
interface DevProviderConfig<TDevState, TBetResult> {
controls: DevControl[];
defaultState: TDevState;
generateBetResponse(
betAmount: number,
betType: string,
devState: TDevState,
): TBetResult;
}Constants
PROVIDER_NAMES
const PROVIDER_NAMES = {
GO3: 'go3',
RIPPINRUMBLE: 'rippinrumble',
STEPPER: 'stepper',
GP: 'gp',
} as const;Bet type constants
Each predefined provider exports its bet type union + matching constants. They're documented inline in the per-provider sections above: Go3BetType, StepperBetType, RippinRumbleBetType. GP has none by design.
import {
GO3_BET_TYPES, GO3_DEFAULT_BET_TYPE, GO3_BOOSTED_BET_TYPE, type Go3BetType,
STEPPER_BET_TYPES, STEPPER_DEFAULT_BET_TYPE, type StepperBetType,
RIPPINRUMBLE_BET_TYPES, RIPPINRUMBLE_DEFAULT_BET_TYPE, RIPPINRUMBLE_BOOSTED_BET_TYPE, type RippinRumbleBetType,
} from '@rollerz/types';MessageType
Enum for bridge message types.
| Value | Description |
|---|---|
GAME_LOADED | Game has loaded |
GAME_LOADED_ACK | Server acknowledged game load |
BRIDGE_READY | Bridge iframe is ready |
API_CALL | Outgoing API request |
API_RESULT | Incoming API response |
ERROR | Error message |