Skip to Content
Examples

Plot ships two kinds of example code: a showcase of playable games you can try right now, and starter templates you clone to begin your own game. Both are open source under the plot-ws org.

The showcase

plot-showcase is one small Vite + TypeScript app with three playable games — the repo linked from plot.ws . Each game is a few hundred lines on top of @plot/client, and together they cover the four shapes of multiplayer Plot is built for.

GameUse-casePlot features it shows
Blobs.io arena Client prediction + remote interpolation + an authoritative handler + a leaderboard
Caption ClashParty  + Turn-based Room codes, presence, a shared scoreboard, and one round engine driving both a simultaneous and a sequential mode
SiegeCo-op An authoritative server simulating waves, enemy pathing, and damage
git clone https://github.com/plot-ws/plot-showcase cd plot-showcase npm install VITE_PLOT_APP_KEY=pl_pub_live_xxx npm run dev # key from your dashboard

Open the printed URL, pick a game, and open a second tab (or share the room code) to go multiplayer.

Starter templates

Each starter is a minimal, fully-working Vite + TypeScript project — an authoritative handler (src/handler.ts), the pure game rules (src/logic.ts, unit-tested), and a thin client (src/main.ts). Clone the one that matches your game and build from there.

StarterForWhat you get
plot-io-starter.io gamesAuthoritative movement: the server owns positions, the client predicts the local player and interpolates everyone else.
plot-lobby-starterParty & turn-basedA room-code lobby with presence, timed rounds, and a shared scoreboard — the base for both shapes.
plot-coop-starterCo-op / PvEAn authoritative shared world: the server owns enemies and damage; clients send inputs and render.
git clone https://github.com/plot-ws/plot-io-starter # or -lobby-/-coop- cd plot-io-starter npm install npm run dev

Every starter ships npm test (the pure logic is unit-tested), npm run typecheck, and npm run build.

Connecting to Plot

The demos read their connection settings from Vite env vars:

VariablePurpose
VITE_PLOT_APP_KEYYour publishable app key (pl_pub_live_…) from the dashboard .
VITE_PLOT_API_URLOptional — point at a local/self-hosted Plot stack instead of the edge API.
VITE_PLOT_ROOMOptional default room code (starters only).

Each game also ships its authoritative handler. Deploy a handler to your app with the Admin CLI, then join its room code to play against the real server.

A note on dependencies

These repos vendor self-contained builds of @plot/client and @plot/handler under vendor/ so they run today. Once the @plot/* packages are on npm, replace the file: dependencies in package.json with the published versions — the import paths (@plot/client, @plot/handler) don’t change.

Deploy

npm run build produces a static dist/. Host it on Cloudflare Workers/Pages static assets — free, and on the same account as your Plot backend. See Deployment.

Last updated on