Skip to main content
This guide walks you through cloning the repo, installing dependencies, and running the lines sample game inside Storybook so you can play a full round locally before writing a single line of game code.
1

Install Node.js 22.16.0

The SDK requires Node.js version 22.16.0. The recommended way is via nvm:
# Download and install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash

# Source nvm without restarting the shell
\. "$HOME/.nvm/nvm.sh"

# Install Node.js 22.16.0
nvm install 22.16.0

# Verify — should print "v22.16.0"
node -v
2

Install pnpm 10.5.0

The monorepo uses pnpm workspaces. Install the required version globally:
npm install [email protected] -g

# Verify — should print "10.5.0"
pnpm -v
3

Clone the repository

git clone https://github.com/StakeEngine/web-sdk.git
cd web-sdk
4

Install dependencies

From the repo root, install all workspace dependencies in one command:
pnpm install
If no error messages appear, you are ready to continue.
Windows users: Storybook may fail to start without cross-env. If you encounter an error, update the storybook script in apps/lines/package.json:
"storybook": "cross-env PUBLIC_CHROMATIC=true storybook dev -p 6001 public"
Initial Storybook loading on Windows can take up to 15 minutes, but hot reloads after that are fast.
5

Run the lines game in Storybook

TurboRepo’s --filter flag targets a specific workspace package by the name field in its package.json. The sample game is named lines:
pnpm run storybook --filter=lines
Storybook opens in your browser. You will see a sidebar with story sets like COMPONENTS, MODE_BASE, and MODE_BONUS.
6

Play a base game round

  1. In the Storybook sidebar, navigate to MODE_BASE → book → random.
  2. An Action button appears in the bottom-left corner of the game canvas.
  3. Click Action and wait for a complete base game round to finish.
You now have a fully functional game running locally against randomly generated book data—no RGS connection required.

Next steps

Now that the game is running locally, you can explore the rest of the development workflow:
To run the game in DEV mode (a full SvelteKit dev server instead of Storybook), use:
pnpm run dev --filter=lines
You will see an authentication error screen—this is expected until you connect to a live RGS session. See Building and Launching for instructions on copying the RGS query string into the DEV mode URL.

Build docs developers (and LLMs) love