A shape is a type written as a string, or an object of them. Every value a page sends is checked against its field's shape before it's stored or broadcast, so pages can only ever send what the manifest allows.
PropTypeDescription
string"string" · "string(140)"Text, up to 1000 characters or the length given (up to 100000).number"number" · "number(0..1)"Any finite number, optionally within a range. Either end may be left open: "number(0..)".integer"integer" · "integer(1..5)"A whole number, optionally within a range.boolean"boolean"true or false.url"url"An http(s) URL up to 2048 characters.color"color"#rgb, #rgba, #rrggbb or #rrggbbaa.enum"enum(a|b|c)"One of the listed strings (up to 100 options).any"any"Any JSON.- Add ? to make a value optional: "string(80)?" may be left out or null.
- An object of shapes describes an object, nested up to four deep. Keys not in the shape are refused.
- A field with no shape accepts any JSON up to 4 KB.
socket.json
123456789{ "cursor": { "type": "stream", "shape": { "x": "number(0..1)", "y": "number(0..1)" } }, "vote": { "type": "map", "shape": { "choice": "enum(yes|no|maybe)" } }, "status": { "type": "value", "shape": { "text": "string(140)", "emoji": "string(8)?", "link": "url?", "busy": "boolean" }, "initial": { "text": "Building things", "busy": false } }}