Field Types

value, counter, list, map, stream and presence — what each holds and what pages can do with it.

Every field has a type. The type decides what the server keeps, what a page can send, and what everyone receives.

PropTypeDescription
valuesetOne shared value — a status line, now playing, a page's settings. Pages see it and get every change. Written by the owner by default (write: "owner"); takes shape and initial.
counterincrA number everyone can bump — likes, votes, visits. incr adds by (default 1, at most ±100 from a page). Takes initial, min, max and perVisitor: how far one visitor's total may move it, so perVisitor: 1 is one like each.
listpushAn append-only feed, capped at keep (default 100, up to 10000) — chat, a guestbook, comments. Each item carries an id, a time and who wrote it. The owner can remove items or clear it.
mapput · dropOne entry per visitor, keyed by who they are — poll answers, reactions, high scores. put sets your own entry, drop removes it. Capped at keep (default 1000); the oldest entry goes first.
streamsendBroadcast only, never stored — cursors, typing, pointer trails. Delivered to everyone else, dropped for a connection that can't keep up. The client sends at most once per animation frame.
presencesetWho's here, with a little state each — name, page, status. Everyone connected who may write it is a member; set changes your own state. One presence field per manifest.

Keys every field takes:

PropTypeDescription
typerequiredOne of value, counter, list, map, stream, presence.
labelstringWhat it is, for people — the app and the dashboard show it.
descriptionstringUp to 500 characters.
readanyone · signed-in · ownerWho receives it. Default anyone.
writeanyone · signed-in · ownerWho may change it. Default owner for value, anyone for everything else.
ratenumberWrites per second per connection (above 0, up to 120). Defaults: stream 60, presence 10, list 2, others 5. A stream quietly drops what's over; other fields answer an error.
shapeshapeWhat a value must look like (value, list, map, stream, presence). See Shapes. Without one, any JSON up to 4 KB is accepted.
initialvalue · counterThe starting value or number.
keeplist · mapHow many items or entries are kept.
min / maxcounterBounds the counter is clamped to.
perVisitorcounterHow far one visitor's own total may move it, either way.

Who a visitor is: a signed-in visitor is their token's sub; an anonymous one is an id the client keeps in localStorage. Anonymous ids are best effort — someone can clear them — so make anything that matters (one vote each, a guestbook) write: "signed-in".