Quickstart
Install dependencies, run the sample game in Storybook, and play your first round in under 10 minutes.
Core Concepts
Understand books, bookEvents, emitterEvents, and the event-driven game loop that powers every game.
Add a BookEvent
Step-by-step guide to extending a game with a new bookEvent and wiring it to Svelte components.
API Reference
Complete reference for all pixi-svelte components, utility functions, and the RGS fetcher.
How it works
The SDK models each game round as a book — a JSON payload returned by the RGS that contains an ordered array of bookEvents (e.g.,reveal, winInfo, freeSpinTrigger). Your game processes each bookEvent sequentially, broadcasting emitterEvents to Svelte components that handle animations, UI updates, and audio.
RGS returns a book
The Remote Game Server responds to a bet request with a
book — a JSON object containing the game outcome as an ordered array of bookEvents.playBookEvents() processes each event
playBookEvents() iterates through the array in order, calling the matching handler in your bookEventHandlerMap for each event.Handlers broadcast emitterEvents
Each
bookEventHandler calls eventEmitter.broadcast() or eventEmitter.broadcastAsync() to send typed events to subscribed Svelte components.Sample games
The SDK ships with five fully-implemented reference games you can run, study, and fork:lines
Classic payline slots with free spin bonus mode.
cluster
Cluster-pay mechanic with tumble/cascade support.
scatter
Scatter-pay game with anticipation animations.
ways
All-ways-pay slots mechanic.
price
Price-based game variant.
number-picker
Number selection game type.
Key packages
pixi-svelte
Svelte 5 components wrapping PixiJS 8 primitives:
App, Container, Sprite, SpineProvider, ParticleEmitter, and more.utils-event-emitter
The typed event bus connecting JavaScript game logic to Svelte component trees.
utils-xstate
XState-powered finite state machine managing bet, autoBet, and resumeBet game flows.
utils-book
createPlayBookUtils() for sequential bookEvent processing with full TypeScript inference.