OBS Module
Full OBS Studio control — scenes, sources, audio, streaming, recording, and more.
The OBS module connects OBS Studio to Rawtoh via the OBS WebSocket protocol. It gives you full control over your scenes, sources, audio, streaming, and recording — all from your automations.
Getting started
OBS runs on your machine, out of reach of a hosted service. The module therefore works in two halves: a hosted backend that holds the Rawtoh connection, and a browser tab on the streaming PC that talks to OBS on localhost and relays calls and events. Keep that tab open while you stream — calls fail with an explicit error while it's closed.
- In OBS, enable the WebSocket server (Tools → WebSocket Server Settings) and note the port and password
- Open the OBS module site, sign in with your Rawtoh account and pick your organization
- Add an OBS account with that host, port and password — the credentials stay on the server, never in browser storage
- Click Install with Rawtoh. The module creates the instance in your organization, enrolls its key pair and connects. No token to copy; you need the owner role
- Leave the tab open on the streaming PC. One account per OBS install — add more for a second machine
For a live show, prefer the local OBS module: a single binary that runs next to OBS, with no browser tab to keep open, and reconnects on its own when OBS or the network drops. Same events and methods. See Security & reliability for the setup.
Events
The OBS module emits events for everything that happens in OBS Studio. Use these as triggers to react automatically.
Scenes
| Event | Description |
|---|---|
scene.current_changed | Active scene changed |
scene.preview_changed | Preview scene changed (studio mode) |
scene.created | New scene created |
scene.removed | Scene removed |
scene.name_changed | Scene renamed |
scene.list_changed | Scene list changed |
studio_mode.state_changed | Studio mode enabled / disabled |
Streaming & recording
| Event | Description |
|---|---|
stream.state_changed | Streaming started / stopped |
record.state_changed | Recording started / stopped |
replay_buffer.state_changed | Replay buffer started / stopped |
virtual_cam.state_changed | Virtual camera toggled |
exit.started | OBS is shutting down |
Sources, inputs & transitions
| Event | Description |
|---|---|
input.mute_state_changed | Input muted / unmuted |
input.volume_changed | Input volume changed |
input.created / input.removed / input.name_changed | Input added, removed or renamed |
scene_item.enable_state_changed | Source visibility toggled |
filter.enable_state_changed | Filter enabled / disabled |
transition.started / transition.ended | Scene transition started / finished |
transition.current_changed | Active transition changed |
Event payloads are forwarded unchanged from obs-websocket, so field names are camelCase — e.g. event.payload.sceneName.
What you can do
Call these methods from your actions to control OBS. Params use the obs-websocket names, in camelCase — e.g. module("obs").request("scene.set_current", { sceneName: "BRB" }):
Scenes & studio mode
scene.set_current/scene.get_current— switch to a scene / read the active onescene.list— get all scenesscene.create/scene.removescene.set_preview/scene.get_preview— preview scene (studio mode)studio.set_mode/studio.get_mode— toggle studio mode
Sources & inputs
scene_item.set_enabled/scene_item.get_enabled— show or hide a sourcescene_item.list— list the sources of a sceneinput.set_mute/input.toggle_mute/input.get_mute— mute/unmuteinput.set_volume/input.get_volume— change volumeinput.list— list inputsmedia.play/media.pause/media.stop/media.restart/media.next/media.previous/media.set_time/media.get_status— control media inputs
Streaming & recording
stream.start/stream.stop/stream.toggle/stream.get_statusstream.send_caption— send a caption on the streamrecord.start/record.stop/record.toggle/record.pause/record.resume/record.toggle_pause/record.get_statusreplay_buffer.save/replay_buffer.start/replay_buffer.stop/replay_buffer.toggle/replay_buffer.get_status
Filters & transitions
filter.set_enabled— enable/disable a filterfilter.list— list the filters of a sourcetransition.set_current/transition.get_current/transition.list— change or read the active transitiontransition.set_duration— change the transition durationtransition.trigger— trigger a transition manually (studio mode)
Other
general.trigger_hotkey— trigger any OBS hotkey by namegeneral.get_version/general.get_statsscreenshot.get— screenshot a source (returns base64 image data)virtual_cam.start/virtual_cam.stop/virtual_cam.toggle/virtual_cam.get_statusobs.call— generic passthrough:{ requestType, requestData? }for any obs-websocket request not listed above (e.g.SetInputSettings,SetSceneItemTransform)
Example automations
- Raid on Twitch → switch to welcome scene, show a raid alert source
- Stream goes live → post go-live notification in Discord, start recording
- Board button clicked → switch to BRB scene, mute mic
- Song changes on Spotify → update a text source with the current track name
- Chat command → toggle a filter on the webcam, trigger a hotkey