A JavaScript/TypeScript library for connecting to OBS Studio's obs-websocket plugin (v5 protocol). Current stable version is 5.0.8, released in June 2023. Provides a Promise-based API for controlling OBS via WebSocket, supporting both JSON and MessagePack encodings. Includes full TypeScript definitions, works in Node.js (>=16) and browsers. Key differentiator: actively maintained community fork of the original Palakis library, with support for the latest obs-websocket 5.x protocol.
npm install obs-websocket-jsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Connects to OBS WebSocket, retrieves scene list, and starts recording using the v5 protocol's 'call' method.
Replace obs.on('SwitchScenes', handler) with obs.on('SceneChanged', handler) and use obs.call('SetCurrentProgramScene', { sceneName }) instead of obs.send('SetCurrentScene').Update OBS and obs-websocket plugin to version 5.0.0 or later.
If bundling for browser, set target to 'web' or provide a polyfill for 'ws' if needed. In Node.js, the 'ws' package is automatically used.
Replace obs.send('SetCurrentScene', ...) with obs.call('SetCurrentProgramScene', ...).Use import { OBSWebSocket } from 'obs-websocket-js' or const { OBSWebSocket } = require('obs-websocket-js').Update OBS and obs-websocket plugin to version 5.0.0 or later.
If targeting browser, set resolve.fallback: { ws: false } in webpack or use a polyfill. Alternatively, import from 'obs-websocket-js/browser' if available.