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
-[Connecting to the API Server](#connecting-to-the-api-server)
13
16
-[Channel System Explained](#channel-system-explained)
14
17
-[Available Commands](#available-commands)
@@ -88,6 +91,126 @@ The WebSocket API allows real-time, bidirectional communication between your app
88
91
89
92
If you prefer to keep traffic peer-to-peer without enabling the WebSocket relay, you can instead integrate the Social Stream Ninja WebRTC SDK. It offers a Node- and browser-friendly interface that plugs into the same transport layer used by the extension. A Social Stream Ninja listener example is available at [ninjasdk/demos/socialstreamninja-listener.js](https://github.com/steveseguin/ninjasdk/blob/main/demos/socialstreamninja-listener.js).
90
93
94
+
### Choose Your Use Case
95
+
96
+
There are two main reasons to use the WebSocket API:
97
+
98
+
| Use Case | What You Want | Required Toggle(s) | Channel |
|**Remote Control**| Send commands to SSN (clear, feature, next in queue, send chat) from StreamDeck, Bitfocus Companion, or custom apps | ✅ Enable remote API control | Channel 1 (default) |
101
+
|**Chat Listener**| Receive chat messages from Twitch/YouTube/etc. in your Python/Node app | ✅ Enable remote API control + ✅ Send chat messages to API server (3rd toggle) | Channel 4 |
ws.send(JSON.stringify({ action:"sendChat", value:"Hello from API!" }));
133
+
};
134
+
```
135
+
136
+
See the [StreamDeck Integration Guide](#streamdeck-integration-guide-for-social-stream-ninja) and [Bitfocus Companion](#using-bitfocus-companion-with-social-stream-ninja) sections below for detailed setup.
Note: You only need either WebRTC (P2P) <em>or</em> the API WebSocket; both are not required. WebRTC uses the VDO.Ninja signaling server for peer discovery; the API WebSocket is for optional server-based control/relay.
Note: WebRTC (P2P) is the default transport. The API WebSockets are optional: 🎮 Remote Control for StreamDeck/Bitfocus commands, 📡 Chat Relay to receive chat in external apps (Python/Node).
<pclass="test-help" style="color: #a0a0a0; font-size: 13px; margin: 6px 0 0 0;">Applies to message-properties “last activity” filters using the current time as reference.</p>
828
-
</div>
829
-
830
-
<divclass="test-options">
831
-
<labelclass="test-checkbox">
832
-
<inputtype="checkbox" id="test-all-active-flows">
833
-
Test against all active flows (not just current flow)
<pclass="test-help" style="color: #a0a0a0; font-size: 13px; margin: 6px 0 0 0;">Applies to message-properties “last activity” filters using the current time as reference.</p>
844
+
</div>
845
+
846
+
<divclass="test-options">
847
+
<labelclass="test-checkbox">
848
+
<inputtype="checkbox" id="test-all-active-flows">
849
+
Test against all active flows (not just current flow)
0 commit comments