Developer follow-along

Ship It In 20 Minutes

Agent-built. Cloudflare-deployed. No account required — until you want to keep it.

Start the follow-along

A 15–20 minute follow-along: deploy a Worker with a temporary account, turn it into a game, add KV storage, then multiplayer with Durable Objects.

You will not write the application code. Your coding agent will. You paste prompts, confirm deploys, and watch something real land on Cloudflare's network — starting withzero accounts created.

Step 0 · before you start

Before you start

You need:

  • Node.js and a terminal
  • A coding agent — whatever you already use. If you don't have one, OpenCode with free models can get through the early steps.
  • An empty folder to work in (or let the agent create one)

You do not need a Cloudflare account yet. That's the point.

Optional: if you've used wrangler before and might still be logged in, run this so the temporary-account path is used. If you don't know what that means, skip it — it doesn't apply to you.

Optional · only if already logged in
npx wrangler logout

Step 1 · ~3 min

Deploy Hello World

One prompt. A live URL on Cloudflare's global network. No signup.

Open your agent in an empty directory. Paste a prompt below. Let it run — create the project, install wrangler, deploy.

Guided spells out the deploy path. Minimal is the plain ask — a solid model usually lands on temporary accounts on its own.

Spelled out so it works reliably live

Step 1 · Hello World · Guided
Make a very simple hello world Cloudflare Worker in TypeScript and deploy it using wrangler. Don't ask me questions — do the best you can.

Important:
- Use TypeScript
- Always invoke wrangler via npx wrangler (install wrangler as a project dependency if needed)
- If wrangler says you're not logged in, deploy with: npx wrangler deploy --temporary
- After deploy, print the live URL and the claim URL if one is shown
- Verify the live URL returns "Hello World!" (or similar)

Do not create an account

If the agent tries to push you toward wrangler login, a browser OAuth flow, or signing up for Cloudflare — stop it. Tell it to deploy with a temporary account (npx wrangler deploy --temporary) and to figure out what that means if it needs to. No signup. No login. Temporary only.

Checkpoint

You have a live https://….workers.dev URL that returns Hello World, and a claim URL in the deploy output. Hold onto both — you'll need the claim URL at the end.

Aha

That Worker is already running on Cloudflare's edge worldwide. No account was created. You have a 60-minute window to claim the temporary preview account and keep everything in it. Redeploys reuse the same temp account until you claim, log in, or the window expires.

Worker*.workers.devInternet

Architecture so far: one Worker, global by default.

Step 2 · ~4 min

Make it a game

Hello World is fine. A game is more fun — and proves the Worker can serve a full interactive UI.

Pick a game (Snake is the default and the rest of the session assumes it). Paste the matching prompt. Same project, same temp account, new deploy.

Try Minimal if you want to see how little you have to say.

Spelled out so it works reliably live

Step 2 · Snake · Guided
Turn this Worker into a polished single-player Snake game served as HTML from the Worker.

Requirements:
- One Worker, TypeScript, no external frontend framework
- Serve a complete HTML page (with CSS + JS inline or as strings) from the fetch handler
- Keyboard controls (arrow keys + WASD) and on-screen buttons for mobile
- Score counter, game over, restart
- Make it look good — pocket-arcade vibe is fine
- Redeploy with the same temporary account (npx wrangler deploy --temporary if still unauthenticated)
- Print the live URL when done

Checkpoint

Open the same (or updated) *.workers.dev URL. Play a round. It should feel like a real game, not a demo stub.

Aha

Still one Worker. Still no account. The HTML, CSS, and game loop are just a Response from the edge — no separate frontend host, no CDN config.

Step 3 · ~4 min

Add storage (KV leaderboard)

A game without a high-score board is unfinished. Time for a Cloudflare primitive.

Workers KV is a globally distributed key-value store. Low-latency reads at the edge, eventually consistent writes — perfect for leaderboards, config, session lookups, and cached data.

Guided names KV and the binding. Minimal just asks for a leaderboard — a capable model usually picks KV on its own.

Spelled out so it works reliably live

Step 3 · Leaderboard · Guided
Add a Cloudflare KV leaderboard to this game.

Requirements:
- Create a KV namespace binding named LEADERBOARD in wrangler.jsonc (or wrangler.toml)
- On game over, let the player enter 3 initials and POST the score
- GET endpoint returns the top 10 scores
- Show the leaderboard in the UI
- Keep the existing game working
- Redeploy with npx wrangler deploy --temporary if still unauthenticated
- Print the live URL when done

Do not ask me to create the namespace in the dashboard — configure it in wrangler so deploy provisions it.

Checkpoint

Play a game, submit initials + score, refresh. Your score should still be there. Open the URL on a second device if you can — same leaderboard.

Aha

You now have compute and storage on the edge, still inside a temporary account you haven't signed up for. Architecture just got real.

WorkerKV · LEADERBOARD
*.workers.devplayers worldwide

Worker + globally distributed key-value storage.

Step 4 · ~5 min

Go multiplayer (Durable Objects)

Single-player is cool. Two tabs playing the same room is cooler.

Durable Objects give you a tiny, strongly consistent server per entity — a chat room, a game lobby, a shopping cart, a user session. Each object has its own storage, can hold WebSockets, and runs single-threaded so coordination is simple: no distributed locks, no "who won the race?" guesswork.

One Durable Object per room. Prompts below match the game you picked in Step 2.

Model note

This step is the hardest one. WebSockets + Durable Objects + game loop is a real design problem. Stronger models handle it; free/small models often stall. If your agent spins or produces broken code after a couple of tries, use the fallback below and keep moving.

Guided includes the Durable Objects skill and a full game design. Minimal names Durable Objects and describes the multiplayer mode — enough for a strong model, not a wall of requirements.

Snakes overlap freely; first head on the coin scores. First to 5 wins. Server-authoritative ticks over WebSockets.

Spelled out so it works reliably live

Matches the game you picked in Step 2 — change it here if needed.

Step 4 · Snake multiplayer · Guided
Make this Snake game multiplayer using a Cloudflare Durable Object.

Use this skill for Durable Objects best practices:
https://github.com/cloudflare/skills/tree/main/skills/durable-objects

Game design:
- Multiplayer race: snakes can overlap
- There is one special coin on the board
- First snake head to reach the coin scores a point; coin respawns
- First player to 5 points wins
- WebSocket connection to a GameRoom Durable Object
- Server-authoritative ticks (alarms or equivalent)

Requirements:
- TypeScript Worker + Durable Object class
- Configure durable_objects binding + SQLite migration in wrangler.jsonc
- Use WebSocket hibernation APIs where appropriate
- Rooms via ?room=name (default "lobby")
- Lobby: set a name, see who's in the room, Start button
- Works across two browser tabs / two devices
- Redeploy with npx wrangler deploy --temporary if still unauthenticated
- Print the live URL and short "how to play" notes when done

Don't ask me questions — make reasonable choices and ship it.
Agent stuck? Open the fallback path

Tell your agent to stop inventing and implement from this spec. Or paste the prompt below — it is more prescriptive and usually unblocks weaker models.

Fallback · Snake multiplayer
Continue the multiplayer Snake race.

Game rules: grid 20x20, tick every ~110ms via storage.setAlarm, snakes may overlap, one coin, first head on coin scores +1 and coin respawns, first to 5 wins.
Client input: direction changes (arrow/WASD).

Do not redesign from scratch. Implement exactly this:

1. Create src/room.ts exporting class GameRoom extends DurableObject<Env>
2. One GameRoom instance per room name via env.GAME_ROOM.getByName(room)
3. WebSocket hibernation: acceptWebSocket in the DO, handle tag-based sessions
4. Messages client→server should cover join, input, start, restart
5. Messages server→client: broadcast full public state each tick
6. wrangler.jsonc must include:
   durable_objects.bindings: [{ name: "GAME_ROOM", class_name: "GameRoom" }]
   migrations: [{ tag: "v1", new_sqlite_classes: ["GameRoom"] }]
7. Export GameRoom from the Worker entrypoint
8. Frontend: lobby with name input + Start; show all players; support ?room=name (default lobby)
9. Redeploy with --temporary if needed and print the URL

If something already partially works, fix forward — don't wipe the project.

Still stuck? Clone the reference shape from the Durable Objects skill and docs:

Checkpoint

Open the URL in two tabs (or two devices). Join the same room, hit Start race, and race for the coin. First to 5 wins.

Aha

You just shipped a multiplayer game with server-authoritative state, real-time WebSockets, and per-room isolation — agent-written, on a temporary account, in minutes. That's the Durable Objects pitch in one demo.

Browser A↕ WSWorker↕ WSBrowser B
GameRoom DOper?room=·KV leaderboard

Worker routes WebSockets to a Durable Object per room. Strongly consistent game state lives in the DO; leaderboard can still sit in KV.

Step 5 · ~2 min

Claim it — keep it forever

The temporary account lives for 60 minutes from creation. Claiming moves everything into a real Cloudflare account.

60-minute claim window

Find the claim URL in your first npx wrangler deploy --temporary output — it looks like https://dash.cloudflare.com/claim-preview?claimToken=…

Open it → sign in or create a free Cloudflare account → complete the claim. Your Worker, KV namespace, and Durable Object class stay put. Miss the window and Cloudflare deletes the temp account and everything in it.

  1. Open the claim URL from the deploy output (scroll back if needed).
  2. Sign in to Cloudflare, or create a free account.
  3. Finish the dashboard prompts.
  4. Later deploys: run npx wrangler login, then npx wrangler deploy without --temporary.

Treat the claim URL like a password — anyone with it can take ownership of that temporary account.

Checkpoint

After claiming, the same *.workers.dev URL still works, and the Worker appears under your account in the Cloudflare dashboard.

Aha

You went from zero to a multiplayer edge app, then opted into an account only when you were ready to keep it. That's the temporary-account workflow — built for agents, demos, and "just try it" moments.

After the session

Keep building

Ideas to throw at your agent next:

  • Spectator mode and a public match history stored in D1
  • Custom skins / emotes via R2-hosted assets
  • Private rooms with invite codes (DO storage)
  • A second game mode (teams, sudden death, power-ups)
  • Put the UI on a custom domain once you've claimed the account

Glossary

Worker

Cloudflare's V8 isolate compute at the edge. Handles HTTP, WebSockets, and schedules. Docs

npx wrangler deploy --temporary

Deploys without Cloudflare credentials by creating a temporary preview account. Prints a claim URL valid for 60 minutes. Docs

Workers KV

Globally distributed key-value storage. Fast reads everywhere; eventually consistent writes. Docs

Durable Objects

Strongly consistent, single-threaded objects with their own storage — ideal for coordination, multiplayer, and real-time. Docs · Agent skill

WebSocket hibernation

Lets Durable Objects hold many idle WebSockets without paying for idle compute. Docs

workers.dev

Free *.workers.dev subdomain every account gets for deploying Workers without a custom domain.

What you built today

A globally deployed multiplayer game — agent-authored — using Workers for compute, KV for shared scores, and Durable Objects for real-time rooms. Started with no account. Kept with one click.