Skip to main content

Commands

Send commands from your backend to a live Unity client. All command endpoints sit under:

/sessions/{SessionId}/realtime/commands

Streaming

Streams can be started from within Unity via the SDK, or remotely via the API if a session is already live.

Start stream - POST /sessions/{SessionId}/realtime/commands/stream

{
"resolution": 0,
"aspectratio": 0
}

resolution maps to the BeamResolution enum. aspectratio maps to BeamAspectRatio.

Stop stream - PUT /sessions/{SessionId}/realtime/commands/stream/stop

Recording

The client must already be streaming to record. Recordings can also be started from Unity via the SDK.

Start recording - PUT /sessions/{SessionId}/realtime/commands/record

Stop recording - PUT /sessions/{SessionId}/realtime/commands/record/stop

Camera Control

POST /sessions/{SessionId}/realtime/commands

{
"name": "camera",
"data": {
"controls": [
{ "name": "fieldOfView", "value": "40" },
{ "name": "smoothingAmount", "value": "1" },
{ "name": "cameraView", "value": "1" }
]
}
}

Camera settings follow the same format as BeamXR.Streaming.Core.Rendering.CameraSettings. Use integers for cameraView and lookType enums. See Camera Settings for all available controls.

info

Camera commands also affect the viewpoint of session screenshots.

Text Messages

POST /sessions/{SessionId}/realtime/commands

{
"name": "text",
"data": "Your message here"
}

Listen for messages in Unity via BeamEnterpriseEvents.OnTextEvent.

General Variables

Send typed key-value data to the client. Supports string, bool, int, and float types.

POST /sessions/{SessionId}/realtime/commands

{
"name": "customcommand",
"data": {
"names": ["playerName", "score", "isActive"],
"types": ["string", "float", "bool"],
"values": ["Alice", "1.234", "true"]
}
}

Use any name you like, but avoid names that conflict with built-in events (camera, text). Listen for these in Unity via BeamEnterpriseEvents.OnCommandEvent.