UiElementState ui.element-state@1

Generated at from openvibe-contracts v0.419.0 and openvibe-sdk v0.161.0.

Version
1.0.0
Owner
contracts
Visibility
public
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/ui/element-state.v1.json

ui.element-state@1: the small store an Element keeps for itself (counters, scores, lists, a wheel's entries), as Live broadcasts it to everyone watching and as a read returns it. CHANNEL and ELEMENT_ID name the element instance, REVISION grows by one with each accepted change so a late frame never overwrites a newer one, and VALUES is the store itself: at most 32 keys, each a boolean, a number, a short string or a list of those. It is state, not code: no objects, no markup, no URL and no account data, which keeps a shared element's state safe to render for every viewer.

Fields

FieldTypeRequiredDescriptionConstraints
channelstringyesThe Live channel's username (its slug).
  • pattern ^[A-Za-z0-9_][A-Za-z0-9_.-]{0,63}$
element_idstringyes
  • pattern ^el_[0-9A-HJKMNP-TV-Z]{26}$
revisionintegeryes
  • minimum 0
valueshttps://openvibe.network/contracts/ui/element-state.v1.json#/$defs/valuesyes
updated_atstringyes
  • format date-time

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: counter
{
  "channel": "ada",
  "element_id": "el_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "revision": 4,
  "values": {
    "dances": 3,
    "last_presser": "Maticus",
    "wheel": [
      "a",
      "b",
      3
    ],
    "lit": true
  },
  "updated_at": "2026-11-11T20:31:00.000Z"
}
Rejected: nested-value
{
  "channel": "ada",
  "element_id": "el_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "revision": 1,
  "values": {
    "wheel": {
      "entries": [
        "a"
      ]
    }
  },
  "updated_at": "2026-11-11T20:31:00.000Z"
}
Rejected: uppercase-key
{
  "channel": "ada",
  "element_id": "el_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "revision": 1,
  "values": {
    "Dances": 1
  },
  "updated_at": "2026-11-11T20:31:00.000Z"
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('ui.element-state@1', value);   // { valid, errors: [{ path, message }] }