Vision Module

The vision module allows you to receive and interact with in-game events, such as health changes, eliminations, victories, and more.

Required Permissions: slobs.vision

initiateSubscription method

initiateSubscription(): void

This function must be called before any events or state can be received.

Example

streamlabsOBS.v1.Vision.initiateSubscription();

UserStateTree object

{
  "vision": {
    "fortnite": {
      "eliminations": {
        "session": 152
      }
    }
  }
}

UserState object

{
  "vision.fortnite.eliminations.session": 152
}

VisionEventsPayload object

PropertyTypeDescription
vision_event_idstringA persistent, immutable, and unique identifier for this payload
eventsVisionEvent[]
gamestring
timestampnumber

VisionEvent object

PropertyTypeDescription
namestring
data?VisionEventData[]

VisionEventData object

PropertyTypeDescription
valuenumber

userStateTree event

This event is emitted whenever the user's state changes. Your callback will be called with a UserStateTree object.

Example

streamlabsOBS.v1.Vision.userStateTree(userStateTree => {

});

userState event

This event is emitted whenever the user's state changes. Your callback will be called with a UserState object.

Example

=streamlabsOBS.v1.Vision.userState(userState => {

});

visionEvent event

This event is emitted whenever there is a new Vision event. Your callback will be called with a VisionEventsPayload object.

Example

streamlabsOBS.v1.Vision.visionEvent(visionEventsPayload => {

});