You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you're working in a frontend framework and want to use static imports...
50
+
51
+
```js
52
+
importOBSWebSocketfrom'../../node_modules/obs-websocket-js/lib/OBSWebSocket.js'; //relative path may vary depending on location of node_modules directory
53
+
```
54
+
49
55
Create a new WebSocket connection using the following.
50
-
- Address is optional; defaults to `localhost` with a port of `4444`.
51
-
- Password is optional.
56
+
- Address is optional; defaults to `localhost` with a port of `4444`.
All requests support the following two Syntax options where both `err` and `data` will contain the raw response from the WebSocket plugin.
60
-
_Note that all response objects will supply both the original [obs-websocket][link-obswebsocket] response items in their original format (ex: `'response-item'`), but also camelCased (ex: `'responseItem'`) for convenience._
61
-
- RequestName must exactly match what is defined by the [`obs-websocket`][link-obswebsocket] plugin.
62
-
-`{args}` are optional. Note that both `request-type` and `message-id` will be bound automatically.
65
+
All requests support the following two Syntax options where both `err` and `data` will contain the raw response from the WebSocket plugin.
66
+
_Note that all response objects will supply both the original [obs-websocket][link-obswebsocket] response items in their original format (ex: `'response-item'`), but also camelCased (ex: `'responseItem'`) for convenience._
67
+
- RequestName must exactly match what is defined by the [`obs-websocket`][link-obswebsocket] plugin.
68
+
-`{args}` are optional. Note that both `request-type` and `message-id` will be bound automatically.
63
69
- To use callbacks instead of promises, use the `sendCallback` method instead of `send`.
64
70
65
71
```js
@@ -75,8 +81,8 @@ obs.disconnect();
75
81
```
76
82
77
83
#### Receiving Events
78
-
For all events, `data` will contain the raw response from the WebSocket plugin.
79
-
_Note that all response objects will supply both the original [obs-websocket][link-obswebsocket] response items in their original format (ex: `'response-item'`), but also camelCased (ex: `'responseItem'`) for convenience._
84
+
For all events, `data` will contain the raw response from the WebSocket plugin.
85
+
_Note that all response objects will supply both the original [obs-websocket][link-obswebsocket] response items in their original format (ex: `'response-item'`), but also camelCased (ex: `'responseItem'`) for convenience._
80
86
- EventName must exactly match what is defined by the [`obs-websocket`][link-obswebsocket] plugin.
0 commit comments