Skip to main content

Events & Webhooks

Events are timestamped data points tied to the session (and the video stream, if active). The SDK automatically sends built-in events such as device health and screenshots. You can also send custom events from Unity.

Common Fields​

All events share these fields:

FieldTypeDescription
idstring (UUID)Unique event identifier
sessionIdstring (UUID)The BeamXR session this event belongs to
eventTypestringEvent type (e.g. StreamStarted, Health, StreamStopped, Screenshot)
timestampnumberUnix timestamp in milliseconds

Example Events​

StreamStarted - emitted when a stream begins. Contains the streamingSessionId you'll need to watch or record the stream.

{
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"sessionId": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
"eventType": "StreamStarted",
"timestamp": 1709049600000,
"streamingSessionId": "stream-9876-5432-fedc-ba0987654321"
}

Health - periodic device health snapshot.

{
"id": "e8f9a0b1-2345-6789-abcd-ef0123456789",
"sessionId": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
"eventType": "Health",
"timestamp": 1709049660000,
"fps": 72,
"cpuUsage": 45.2,
"batteryLevel": 87
}

Querying Events​

All events are returned when you fetch a session:

GET /sessions/{SessionId}

Event Types​

TypeDescription
CustomUser-defined events with up to 10 custom fields (custom01–custom10)
HealthDevice metrics: battery, CPU, memory, FPS, error counts
ProgressionLevel/stage progress: start, fail, success with scores
BusinessTransactions: amount, currency, item details
ResourceResource flow: sink/source with amounts
DesignHierarchical design events (up to 4 category levels + value)
ErrorError reports with severity: Critical, Error, Warning, Information, Debug
ImpressionAd/content impression tracking
SessionEndSession termination with total duration

Custom Events​

Send custom events from Unity using the events ingestion endpoint. Each event requires an id, timestamp, and eventType:

{
"events": [
{
"id": "unique-event-id",
"eventType": "Custom",
"timestamp": 100,
"custom01": "Player completed tutorial",
"custom02": "duration:45s"
}
]
}
POST /sessions/{SessionId}/Events

Webhooks​

Register a webhook to receive events in real time as they occur, rather than polling the session endpoint. Contact BeamXR to configure your webhook URL.

note

Webhook registration details and example payloads will be provided in a future update.