LiveElementPressedPayload live.element.pressed@1

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

Version
1.0.0
Owner
live
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/events/payloads/live.element.pressed.v1.json

live.element.pressed v1 (OpenVibe.Live server/elements): a viewer's element press was accepted and ran. It carries the public facts the stream should see: the channel, the element's id and name, the presser's public name and subject, the trigger that fired, the channel points it cost and the element-state revision it left behind. It never carries the presser's email, address, account balance or anything private; a refused press does not produce it. Envelope: subject { type: element, id: el_… }, actor the presser's subject, visibility public, priority low. Also written to the channel's AI timeline as a moment, so the stream's own timeline can cite 'chat made the robot dance'.

Fields

FieldTypeRequiredDescriptionConstraints
channelobjectyesThe public channel facts (the channel page is public already).
  • no other fields
channel.usernamestringyes
  • pattern ^[A-Za-z0-9_][A-Za-z0-9_.-]{0,63}$
channel.display_namestringyes
  • minLength 1
  • maxLength 80
element_idstringyes
  • pattern ^el_[0-9A-HJKMNP-TV-Z]{26}$
element_namestringyes
  • minLength 1
  • maxLength 80
presseridentity.subject-refyes
presser_namestringyesThe display name the stream shows, never an email or an account id.
  • minLength 1
  • maxLength 120
triggerui.triggeryes
points_spentintegerChannel points the press cost; 0 when it was free.
  • minimum 0
state_revisionintegerThe element-state revision after the actions ran; 0 when the element has no state yet.
  • minimum 0
atstringyes
  • format date-time

Examples

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

Valid: chat-command
{
  "channel": {
    "username": "ada",
    "display_name": "Ada"
  },
  "element_id": "el_01JAB2C3D4E5F6G7H8J9K0MNPS",
  "element_name": "Headlight tally",
  "presser": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
  },
  "presser_name": "Maticus",
  "trigger": {
    "kind": "chat_command",
    "command": "!headlights"
  },
  "points_spent": 0,
  "state_revision": 2,
  "at": "2026-11-11T20:31:00.000Z"
}
Valid: press
{
  "channel": {
    "username": "ada",
    "display_name": "Ada"
  },
  "element_id": "el_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "element_name": "Make it dance",
  "presser": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
  },
  "presser_name": "Maticus",
  "trigger": {
    "kind": "press"
  },
  "points_spent": 50,
  "state_revision": 4,
  "at": "2026-11-11T20:31:00.000Z"
}
Rejected: bad-presser
{
  "channel": {
    "username": "ada",
    "display_name": "Ada"
  },
  "element_id": "el_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "element_name": "Make it dance",
  "presser": {
    "type": "user",
    "id": "alice"
  },
  "presser_name": "Alice",
  "trigger": {
    "kind": "press"
  },
  "at": "2026-11-11T20:31:00.000Z"
}
Rejected: missing-element
{
  "channel": {
    "username": "ada",
    "display_name": "Ada"
  },
  "presser": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
  },
  "presser_name": "Maticus",
  "trigger": {
    "kind": "press"
  },
  "at": "2026-11-11T20:31:00.000Z"
}

Validate

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