Local Development
This guide covers running the SDK server locally and deploying with Docker — for Rollerz internal developers and contributors.
Local development
pnpm install
pnpm build
pnpm dev:sdk-server # starts the SDK server on port 3001The server reads .env from the repo root. Key variables:
| Variable | Default | Description |
|---|---|---|
PORT | 3001 | SDK server listen port |
CORS_ORIGIN | * | Allowed CORS origins |
GO3_SERVER_URL | http://localhost:8080/mock | GO3 RGS endpoint |
GO3_BOOSTED_MULTIPLE | 2 | Boosted bet multiplier for GO3 |
RIPPINRUMBLE_SERVER_URL | http://localhost:8080/mock | Rippin Rumble RGS endpoint |
RIPPINRUMBLE_BOOSTED_MULTIPLE | 2 | Boosted bet multiplier for Rippin Rumble |
RIPPINRUMBLE_BASE_BUNDLE_MULTIPLE | 10 | Base-bundle bet multiplier for Rippin Rumble |
STEPPER_SERVER_URL | http://localhost:3000 | Stepper RGS endpoint |
BRIDGE_URL | http://localhost/bridge.html | Bridge URL baked into the SDK bundle at build time |
BRIDGE_ALLOWED_ORIGINS | (empty = allow all) | Comma-separated origins allowed to postMessage to the bridge |
MATH_SERVER_ALLOWED_HOSTS | (empty = no enforcement) | Comma-separated hosts (host[:port]) allowed for body-driven ?server= overrides. Must be set in production to prevent SSRF. |
To point the local SDK server at a staging RGS, change GO3_SERVER_URL (or the relevant provider URL) in .env:
GO3_SERVER_URL=https://math-prod.example.com/rockandsmash-v102/mockEnv vars are fallback defaults
The *_SERVER_URL variables are fallbacks. When the game is launched with ?server=… in the URL (the GammaStack handshake pattern), that value overrides the env default for that launch. To exercise a different math server without touching .env, just append ?server=https://… to the game URL. See Launch URL parameters.
SSRF guard for ?server= overrides
Because ?server= travels in the request body, the SDK server gates outbound POSTs on MATH_SERVER_ALLOWED_HOSTS. When the var is unset (local dev default) any host is accepted; set it in production to an exact-match list of trusted math-server hosts, e.g. math-test-nl.reelsoft.net.
Docker deployment
cp .env.example .env # edit as needed
docker compose build
docker compose up -d # SDK server on port 80The Docker container serves the SDK bundle, bridge, and API behind nginx. See the project README for full Docker commands.