Choose between JSON and Msgpack builds
masterThe dist folder contains two different builds to support different message encodings. Choosing the right one depends on your environment and requirements.
| Encoding | Usage | Benefits | Downsides |
|---|---|---|---|
| JSON | Default / Manual opt-in (import OBSWebSocket from 'obs-web-socket/json') | Easier debugging, smaller bundle | Higher bandwidth usage |
| Msgpack | Web bundles / Node.js (import OBSWebSocket from 'obs-web-socket/msgpack') | Lower bandwidth usage | Harder to debug, larger bundle size |
Note: Modern bundlers will automatically opt into modern builds using modern JS features. If you need to support older browsers, ensure your bundler (e.g., via Babel) transpiles the dependencies.