taking longer than usual.

skip to content
sometimes/ developers

developers / games / start here

Wordle example

the published Wordle game is available as a standalone project that you can run, test and modify using the public SDK.

API 1 · SDK 1.0.2download reference

download and run

extract the ZIP, open the extracted folder in your editor, and open a terminal in the folder containing package.json. the README includes a file map and customization notes. npm run dev starts two local players; start a match and use +10 seconds to advance the countdown. npm test builds and checks the rules. no sometimes repository, private service or admin account is needed.

shell
npm install
npm test
npm run dev

project files

server.ts defines the SDK hooks, rules.ts handles scoring and match phases, and types.ts defines state and tile evaluation. client.tsx connects to the SDK and sends actions. Wordle.tsx renders the board and keyboard. WordleLobby.tsx, WordlePeer.tsx and WordleLeaderboard.tsx render settings, previews and results respectively. wordle.css defines the layout and animations. tests/rules.test.mjs tests the built rules independently of the sometimes app.

host, rounds and scores

configure validates the host, revision, rounds and difficulty. begin chooses a private answer and schedules a three-second countdown. guess validates the round, row and word, then awards 5, 3, 2 or 1 points. the third solve starts the 30-second deadline. when everyone finishes or time expires, results stay for eight seconds. the next transition starts another round or shows the final podium. deadline and timer keep this flow on the server.

private player data

gameView returns your guesses and opponents' tile colors. it withholds the answer until results. the typing signal carries only round, row and letter count, checked again by server.ts; the client coalesces updates and expires stale previews. profiles.get supplies each preview's avatar color. use this pattern for progress hints; omit previews in a shared-world game.

interface and feedback

the client uses useGame for updates, public profiles and audio, DOM keyboard controls, and server timestamps for countdowns. lobby pills, responsive boards, result animations and podiums are game code. the host supplies the surrounding game window, call split, loading screen and minimize/leave controls. sounds follow state transitions so reconnecting does not replay every old result.

modifying and publishing the example

the game code and documentation use the MIT License: retain LICENSE when reusing them. the dictionary keeps WORDS-LICENSE.txt and WORDS-SOURCE.json. Sometimes branding and cover artwork are excluded; use your own. register a game and replace id, name and summary in game.json. update tests with your rules. the import hook only preserves legacy Wordle sessions; new games do not need it. your build still needs admin review and publication.