NetworkPresence network.presence@1

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

Version
1.0.0
Owner
network
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/network/presence.v1.json

network.presence@1 (plan 2026-10-22 track X item 9): one person's online status as another person may see it. OpenVibe.Network owns presence: POST /api/v1/me/presence/heartbeat keeps it fresh, PUT /api/v1/me/presence sets the chosen state, status line and emoji, and GET /api/v1/presence?subjects=… answers for the people the asker follows or has a DM with. The state is derived: online while the newest heartbeat is under 2 minutes old, away after 10 minutes without input (the client's heartbeat says idle), offline after 3 minutes without a heartbeat. Invisible and show_status off are seen as offline, and an invisible person is left out of the answer entirely; last seen is never returned. live is true while the person is streaming on OpenVibe.Live, and only for someone who would otherwise be visible. (The event is network.presence.changed@1.)

Fields

FieldTypeRequiredDescriptionConstraints
subjectstringyesThe person's canonical subject.
  • pattern ^usr_[0-9A-HJKMNP-TV-Z]{26}$
stateenumyesThe public state. A reader never receives invisible (the person is offline instead, or absent from a list); the stored chosen state can be auto, dnd or invisible.
  • one of "online", "away", "dnd", "invisible", "offline"
status_textstring | nullThe person's status line in their own words, or null. Never shown while they are invisible or have show_status off.
  • maxLength 80
emojistring | nullOne emoji that sits beside the status line, or null.
  • maxLength 16
livebooleanThe person is streaming on OpenVibe.Live now. Live outranks their chosen state; it is false while they are invisible or have show_status off.
  • default false
updated_atstringyesWhen the person's presence row last changed.
  • format date-time

Examples

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

Valid: away
{
  "subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "state": "away",
  "status_text": null,
  "emoji": null,
  "live": true,
  "updated_at": "2026-11-07T09:00:00.000Z"
}
Valid: dnd
{
  "subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "state": "dnd",
  "status_text": "Heads down",
  "updated_at": "2026-11-07T09:00:00.000Z"
}
Valid: offline
{
  "subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "state": "offline",
  "live": false,
  "updated_at": "2026-11-07T09:00:00.000Z"
}
Valid: online
{
  "subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "state": "online",
  "status_text": "Building presence",
  "emoji": "🟢",
  "live": false,
  "updated_at": "2026-11-07T09:00:00.000Z"
}
Rejected: bad-subject
{
  "subject": "ann",
  "state": "online",
  "updated_at": "2026-11-07T09:00:00.000Z"
}
Rejected: extra-field
{
  "subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "state": "online",
  "last_seen": "2026-11-07T09:00:00.000Z",
  "updated_at": "2026-11-07T09:00:00.000Z"
}
Rejected: long-status
{
  "subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "state": "online",
  "status_text": "This status line is deliberately longer than eighty characters so the schema refuses it without any doubt at all.",
  "updated_at": "2026-11-07T09:00:00.000Z"
}
Rejected: missing-updated
{
  "subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "state": "online"
}
Rejected: unknown-state
{
  "subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "state": "busy",
  "updated_at": "2026-11-07T09:00:00.000Z"
}

Validate

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