Developer
WebSocket API
Commands
Notifications

Notifications

SendNotification

jsonDataNotification

Shows a notification. Every field is optional.

send('SendNotification', {
  jsonData: {
    title: 'Download complete',
    content: '<b>build.zip</b> finished downloading.',
    timeout: 5,
    audioPath: 'default',
  },
});
Notification
FieldTypeDefault
titlestring""Supports Unity rich text (opens in a new tab).
contentstring""Supports rich text. Empty shows the small form.
timeoutfloat0.5Seconds on screen.
heightfloat175Height when there's content.
opacityfloat10 is treated as 1.
volumefloat0.7
audioPathstring"".ogg path, or "default", "error", "warning". Empty is silent.
iconstring"default"Image path, base64 image, or "default", "error", "warning".
useBase64Iconboolfalsetrue when icon is base64.
sourceAppstring""Your app's name, shown in logs.
typeint1Leave as 1.

PlayAudio

jsonDataAudioClip
send('PlayAudio', { jsonData: { audioPath: 'C:/Sounds/ding.ogg', volume: 0.8 } });
jsonData
{
  audioPath: string
  volume: number            // 0 – 1. Defaults to 0, so always set it.
  spatial: boolean
  spatialPosition: [x: number, y: number, z: number]
  minDistance: number
  maxDistance: number
}

PlayDeviceHaptics

jsonData{ deviceId, duration }
send('PlayDeviceHaptics', { jsonData: { deviceId: 'leftcontroller', duration: 2000 } });
jsonData
{
  deviceId: string    // "leftcontroller", "rightcontroller", or a SteamVR device index such as "3"
  duration: number    // Microseconds, scaled by the Haptics Strength setting
}