pkg:clod/com.clodhub/realtime-rooms 0.14.0 Live shared rooms on the server: people join by name, each sees only what they may see, every change reaches every screen at once, and nothing is lost on a restart. The server side of any application where several people share something live: a game table, a quiz, a planning board. It keeps each room on the server, lets people join under a name, and keeps everyone's screen up to date the moment anything changes. Each person sees only what they are allowed to see: in a card game, a player's own cards are visible to them and to nobody else. The rules of the activity are not part of it. A game or activity plugs in through a game adapter: the adapter says what a move does, what each person may see and what happens over time, and this component does everything around it: - It stores the room so nothing is lost when the server restarts. - It checks each request against the person's private token. - It refuses out-of-date moves. - It sends updates over a live connection, with a slower fallback for devices that cannot hold one. - It runs timers, such as a turn that times out. - It tells the room list (the room-directory component) who is in each room. Watchers can follow a room without taking part, and up to six shared screens (a television showing the table) can join with a token that can never act. It runs on Cloudflare Workers, or on your own machine through server-host. Clients for the web, Apple devices (Swift) and Android (Kotlin) connect to it. Examples Two tables, "one" and "two". Ana and Ben join table one from their phones and each sees their own two cards; Cleo watches and sees neither. The living-room television joins as a shared screen and shows the table without anyone's cards. Ben's phone loses signal; his seat is kept, and when he reconnects with his token he sees where the game is. The server restarts during a hand; nobody loses their chips. A page on another website tries to join on someone's behalf and is refused. Package URL: pkg:clod/com.clodhub/realtime-rooms@0.14.0 Class: Real-time rooms (pkg:clod/com.clodhub/realtime-rooms-class@1.1.0): Rooms that hold state on a server and push changes to every connected client. Any component of this class can fill a recipe slot that asks for it. Category communication/real-time; https://clodhub.com/classes/realtime-rooms-class.txt; 0 other components of this class: https://clodhub.com/components.txt?class=pkg%3Aclod%2Fcom.clodhub%2Frealtime-rooms-class Provides (1) - room-session (com.clodhub/room-session 1.0.0): Persistent private game rooms on Cloudflare Durable Objects and the clients that reach them. Server: createRoomClass and createWorker (server/index.ts, server/worker.ts; constants POLL_MS 25000, MAX_DISPLAYS 6, DISPLAY_IDLE_MS 3600000, LIVE_MS 75000). Clients: Live (web/live.ts), LiveConnection (Swift), RoomTransport (Kotlin). The HTTP routes are in interfaces/room-session-http.json (OpenAPI 3.1.1) and the live messages in interfaces/room-session-live.json (AsyncAPI 3.1.0). The directory object is not provided here: rooms call the DIRECTORY namespace, which the application binds to room-directory's createDirectoryClass. components that use it: https://clodhub.com/components.txt?requires=com.clodhub%2Froom-session Requires (2) - game-adapter (com.clodhub/game-adapter 1.0.0): The GameAdapter a room server calls (realtime-rooms), over a turn engine that drives any game written to com.clodhub/game-rules. Build it with createGameAdapter(parts, settings), where parts holds one implementation of each required interface; methods named `GameAdapter.` are members of the object it returns. State is JSON-serialisable and every method is pure. Wire actions: start, addBot, kick {playerId}, leave, sitOut, return, pause, resume, cancel, newGame, rebuy {accept}, and any move the game's parseMove accepts. Error codes and HTTP status: badName 400, badRequest 400, roomFull 409, staleVersion 409, badToken, notYourTurn, wrongPhase, notEnoughPlayers, badAmount, badTarget, notAllowed, paused, unknownPlayer 422; a code a game reports that is not in this list is sent as notAllowed. Without a computer-players part (parts.computers omitted) addBot is refused and no seat is filled. TypeScript, `implementation/server/adapter.ts` (engine.ts, parts.ts, no-computers.ts). components that provide it: https://clodhub.com/components.txt?provides=com.clodhub%2Fgame-adapter - guest-identity (com.clodhub/guest-identity 1.0.0): Guests known by the name they type, with private bearer tokens that rotate. Pure functions over a plain book (server/identity.ts, storage belongs to the caller), the same functions with the settings bound once (createIdentityApi, what seating and realtime-rooms call), and a device-side store of the name and per-slot tokens (web/identity-store.ts, Swift and Kotlin IdentityStore with NameRules). Methods are tagged with the languages that provide them. Over the wire a client sends {name}, the server answers {token, playerId}, later requests carry Authorization: Bearer , and a response may carry a rotated token. components that provide it: https://clodhub.com/components.txt?provides=com.clodhub%2Fguest-identity Settings (0) There are no installer settings. The application gives three values in code (`Settings`): - `applicationId`: a short name for the application, such as `ourpoker`, shown by the server's health check. - `allowedOrigins`: the web addresses whose pages may use the rooms from a browser, such as `["https://ourpoker.example.com"]`. Pages on `localhost` or `127.0.0.1` (any port) are always allowed, for development. A page from any other site cannot read answers, cannot open a live connection, and is refused (403) if it tries to change anything. - `roomPrefix`: the prefix of the names under which rooms are stored and video rooms are named, including its separator, such as `ourpoker-`. Which rooms exist is the list of room ids the application passes to `createWorker`, for example `["one", "two"]`. Depends on components: none How to use in a recipe A recipe uses it through a slot of class Real-time rooms (pkg:clod/com.clodhub/realtime-rooms-class 1.1.0), naming pkg:clod/com.clodhub/realtime-rooms as the slot's preferred component or substituting it for another component of the class. The recipe connects what it provides (room-session) to the slots that use it. It fills what the component needs (game-adapter and guest-identity) from slots whose components provide them. It has no settings. - as a slot in recipe.json components: {"id":"realtime-rooms","class":{"name":"pkg:clod/com.clodhub/realtime-rooms-class","version":"1.1.0","digest":"1d3f39e03f8b26caafc36caaf501876bb1a2012b90f65abf549ff3d6432c71da"},"preferred":{"name":"pkg:clod/com.clodhub/realtime-rooms","version":"0.14.0"}} - in place of another component of the class: clod fetch realtime-rooms@0.14.0 --store store --from https://clodhub.com, then clod design RECIPE@VERSION --store store --answers answers.json --substitute SLOT=realtime-rooms@0.14.0 --out definition.json Used by recipes: pkg:clod/com.clodhub/ourpoker-recipe 0.13.0 (slot realtime-rooms) For developers: how an application uses it The application's server module exports a room class, the directory class and the worker: ```ts import { createRoomClass, createWorker } from "./components/realtime-rooms/server/index"; export const Room = createRoomClass(adapter, { identity: createIdentityApi(identitySettings) }, settings); export { Directory } from "./directory"; // room-directory's createDirectoryClass export default createWorker(settings, ["one", "two"]); ``` Clients join a room with `POST /r//join` and a name, keep the token they get back, and then either open the live connection (`Live` on the web, `LiveConnection` on Apple, `RoomTransport` on Android) or poll `/r//state`. Each client turns the view it receives into screens; the component does not draw anything. `fixtures/worker.ts` is a complete small application (a shared counter with a private value per person) that uses no poker code. Accounts and services To run it on the internet you need a Cloudflare account (Workers and Durable Objects). The free plan allows 100,000 requests a day and 5 GB of storage; the paid plan removes the request limit. It also runs on your own machine through server-host, with no account. The checks need neither. How it is checked The required checks run the component in Cloudflare's local runtime, with no account: - `npm test`: private values reach only their owner; watchers and shared screens see no private value and cannot act; out-of-date moves are refused; tokens are replaced and renewed; a name the identity component refuses is refused; leaving works; several connections per person work; a deliberate close is told apart from a lost connection; rooms survive a restart; timers fire; the room list is updated; and pages from other sites cannot change anything. - `node tests/request-body.mjs`: refused uploads are read and discarded safely. - `npm run typecheck`: the code type-checks. - `node --test tests/migration.test.ts tests/interfaces.test.ts`: room data can be exported, imported and verified; the interface documents match the code (every adapter and identity method used, every route served, every live message sent); and the guest-identity port is required. Updates Updates replace the source files after the application is checked. The rooms' saved data belongs to the deployment: removing the component does not delete it from Cloudflare or the server's data folder. `migration.json` describes the saved data (key `room`, layout version 1, schema `interfaces/room-state.schema.json`, each room's identity book under `identity`), and the export, import and per-record checks (counts and sha256) that move it between deployments. The room list's data is described by room-directory's `migration.json`. Tags: communication, real-time, realtime, rooms Targets: client android, ios, macos, tvos, web, windows; server hosting-provider, own-hardware Publisher: George McIntyre (george-mcintyre) Guardians: Level N Ltd (guardian key 08775f20) Source: clodhub/realtime-rooms release v0.14.0; digest sha256:5a8815c4ffcf87deeb1525c51f893308a88d888d8f57a1d1fdd1c4db048da2b6 Release: features Line 0.14: no security releases Quality: Integration-tested, certified Known vulnerabilities: none known (checked 2026-11-26 at OSV); https://clodhub.com/api/components/realtime-rooms/0.14.0/vulnerabilities Downloads: 1 in 30 days; 1 of this version Classes: https://clodhub.com/classes.txt; this component as JSON: https://clodhub.com/api/components/realtime-rooms/0.14.0 Bundle download: GET https://clodhub.com/api/components/realtime-rooms/0.14.0/bundle returns a link valid for one hour Implements: pkg:clod/com.clodhub/realtime-rooms-class@1.1.0 1d3f39e03f8b26caafc36caaf501876bb1a2012b90f65abf549ff3d6432c71da com.clodhub/room-session 1.0.0 entry modules: android android/src/main/java, ios apple/Sources, macos apple/Sources, server server/index.ts, tvos apple/Sources, web web/index.ts, windows web/index.ts shared behaviour suites: shared Platforms: android, ios, macos, server, tvos, web, windows Toolchains: android >=8.0.0, ios >=17.0.0, java >=17.0.0 <27.0.0, kotlin =2.4.21, macos >=14.0.0, node >=26.5.0 <27.0.0, swift =6.4.2, tvos >=17.0.0 Frameworks: none Styles: scope none; 0 namespaces; 0 conflicts Licence: Apache-2.0; 197 upstream sources, 194 exact dependencies, 245 files (listed on the details page) Suitable for jobs: realtime-rooms profile free: cost free; load requestsPerDay 100000, storedMegabytes 5000; regions any; compliance none; Cloudflare Workers and Durable Objects (SQLite-backed) Workers Free profile paid: cost metered; load none; regions any; compliance none; Cloudflare Workers and Durable Objects (SQLite-backed) Workers Paid profile own-hardware: cost none; load none; regions any; compliance none; Own hardware running the room code on Node through server-host own-hardware Notes: Local checks need no account. Deployment needs a Cloudflare account supplied by reference. Limits above come only from the two Cloudflare pages named in the profile notes. The own-hardware profile has no provider limits page; limitsSource is null. Data migration: stores rooms (com.clodhub/room-state 1.0.0); formats ndjson; requires stop no; retention 30 days Maintainers: Level N Ltd; https://github.com/clodhub/realtime-rooms/issues; updates https://github.com/clodhub/realtime-rooms/releases (manual) What you download realtime-rooms-0.14.0.tar, from release v0.14.0 of clodhub/realtime-rooms: 245 files - Documents and manifests (14): CONTRACT.md, INSTRUCTIONS.md, LICENCE, NOTICE, PROVENANCE.md, SOURCE.md, ... - Source code (7): android/ (1), apple/ (1), server/ (3), web/ (2) - Tests (6): interfaces.test.ts, live.test.ts, migration.test.ts, request-body.mjs, rooms.test.ts, test_packaged_review.py - Test data (2): identity.ts, worker.ts - Interface documents (7): required-game-adapter.json, required-guest-identity.json, required-room-directory-http.json, room-session-http.json, room-session-live.json, room-session.json, ... - Class files: the class's interfaces and shared checks (3): realtime-rooms-class/ (3) - Examples (1): migration.ts - Diagrams (5): definition.json, examples/ (1), output/ (3) - Scripts (1): package-metadata.py - Licence notices of upstream code (199): npm/ (199) Installing copies 7 of them into the application under components/realtime-rooms/: android 1, apple 1, server 3, web 2 Not included: the components that provide what it requires (com.clodhub/game-adapter, com.clodhub/guest-identity), each a separate download; the values of its settings, which the recipe writes; any secret The archive is a release file on the publisher's public GitHub repository; ClodHub keeps this page and a pointer to the release, not the code. clod checks the archive's sha256 fingerprint before anything is copied, and installing runs none of the package's code. Versions - 0.14.0 features (2026-11-26T11:31:09.120Z) sha256:5a8815c4ffcf87deeb1525c51f893308a88d888d8f57a1d1fdd1c4db048da2b6 Links Details (package foundations, upstream sources, exact dependencies, styles, class inventories, files): https://clodhub.com/components/realtime-rooms/details.txt?version=0.14.0 Page: https://clodhub.com/components/realtime-rooms; JSON: https://clodhub.com/api/components/realtime-rooms/0.14.0; connections diagram: https://clodhub.com/api/components/realtime-rooms/0.14.0/connections.svg Copyright Level N Ltd 2026