simple-obs
🎥
The simplest way to control OBS from JS
Using obs-websocket
can be difficult. Small manipulations of scenes and scene items are manageable, but keeping track of scenes, sources, settings, filters and more can quickly become a daunting task.
simple-obs
aims to fix this. By working with Scene
, Source
, and SceneItem
objects, you can have unparalleled control over your OBS layouts.
If you're familiar with databases, it's like an ORM for OBS!
Beta Warning
This library is not well tested and is still under heavy development. Feel free to use it, but make sure you make a backup of your scene collections before doing anything with simple-obs
.
Features
- Persistence across code reloads, so scenes and items aren't deleted and recreated each time you run your code
- Automatic request batching
-
Scene
,Source
andSceneItem
are designed to be overridden, allowing for complex layouts to be abstracted into subclasses - Easy integration into existing layouts with
Scene.link()
, allowing for incremental migration tosimple-obs
without handing over your entire layout to your code
Installation
-
Install the fork of
obs-websocket
simple-obs
exposes some functionality (eg.obs.clean()
,Scene.remove()
) that requires installing a custom fork ofobs-websocket
. This fork simply adds support for removing scenes, retaining all other previous functionality.simple-obs
will supportobs-websocket
v5 when it is released, which has native support for removing scenes, and also v4 for backwards compatibility. -
Install
simple-obs
yarn add simple-obs
or npm
npm install simple-obs
If using typescript, make sure you are at least using
typescript@4.4.0
, assimple-obs
uses some features of it to provide more accurate types for requests and events. -
Connect to OBS. See the example folder for more info.
Acknowledgements
- JDudeTV for being the catalyst for this project, helping with development and using in production on his stream.
-
HannahGBS for adding RemoveScene support to the
obs-websocket
fork and helping with development and documenting source and filter types. - lclc98 for helping document source and filter types.