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
docs: Clarify API toggles and channels for remote control vs chat listener use cases
- Updated popup.html toggle descriptions with clearer tooltips explaining each toggle's purpose
- Added emoji indicator (📡) to "Send chat messages to API server" toggle to highlight its importance
- Added "Quick Start" section to api.md with two clear use cases:
- Remote Control (StreamDeck/Bitfocus): Toggle 1, Channel 1
- Chat Listener (Python/Node): Toggle 1+3, Channel 4
- Added Python and Node.js sample code for receiving chat messages
- Updated sampleapi.html with clear use case guidance
- Updated docs/commands.html with toggle requirements and improved channel descriptions
- Updated docs/customoverlays.md WebSocket section with toggle reference table
Fixes confusion where users enable API control but don't receive chat messages
because they missed enabling the 3rd toggle for chat relay to channel 4.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: api.md
+120Lines changed: 120 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,6 +88,126 @@ The WebSocket API allows real-time, bidirectional communication between your app
88
88
89
89
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
90
91
+
### Choose Your Use Case
92
+
93
+
There are two main reasons to use the WebSocket API:
94
+
95
+
| 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) |
98
+
|**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!" }));
130
+
};
131
+
```
132
+
133
+
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.
<li><strong>🎮 Remote Control (StreamDeck/Bitfocus):</strong> Enable <em>"Enable remote API control of extension"</em> (Toggle 1) — Connect to <strong>channel 1</strong></li>
212
+
<li><strong>📡 Chat Listener (Python/Node apps):</strong> Enable Toggle 1 + <em>"Send chat messages to API server"</em> (Toggle 3) — Connect to <strong>channel 4</strong></li>
213
+
</ul>
214
+
<p>See the <ahref="../api.md">full API documentation</a> for detailed setup guides and code samples.</p>
Copy file name to clipboardExpand all lines: docs/customoverlays.md
+18-12Lines changed: 18 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,15 +91,21 @@ See `dock.html`, `featured.html`, `events.html` etc. for more examples of iframe
91
91
92
92
For more direct control or server-side integrations, you can connect to the SSN WebSocket server (`wss://io.socialstream.ninja`). This bypasses the need for an iframe but requires handling the WebSocket connection and message parsing directly in your JavaScript.
@@ -181,13 +187,13 @@ A typical message object might look like this (fields vary based on source and e
181
187
}
182
188
```
183
189
184
-
Refer to `about.md` for more details on these fields.
185
-
186
-
> **Note:** Reserve the `event` field for true system notifications (follows, raids, /me actions, etc.). Regular chat messages should leave `event` unset/false so they are never mistaken for events.
187
-
188
-
### Client-Side Filtering and Logic
189
-
190
-
Your JavaScript code will be responsible for deciding what to do with each incoming message.
190
+
Refer to `about.md` for more details on these fields.
191
+
192
+
> **Note:** Reserve the `event` field for true system notifications (follows, raids, /me actions, etc.). Regular chat messages should leave `event` unset/false so they are never mistaken for events.
193
+
194
+
### Client-Side Filtering and Logic
195
+
196
+
Your JavaScript code will be responsible for deciding what to do with each incoming message.
191
197
192
198
```javascript
193
199
functionprocessIncomingSSNMessage(data) {
@@ -591,4 +597,4 @@ This example shows an overlay that only displays new follower and subscriber eve
591
597
-**No `background.js` Modification:** Design your custom page to work with the existing SSN message structure and API. Avoid solutions that would require changing the core extension code.
592
598
-**Consult Examples:** The existing `dock.html`, `featured.html`, `events.html`, `hype.html`, `waitlist.html`, `confetti.html`, and `credits.html` files in the Social Stream Ninja project are excellent resources for seeing how these principles are applied.
593
599
594
-
By following this guide, you can create powerful and customized overlay experiences for Social Stream Ninja.
600
+
By following this guide, you can create powerful and customized overlay experiences for Social Stream Ninja.
Copy file name to clipboardExpand all lines: popup.html
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -5439,7 +5439,7 @@ <h3>Printer Control</h3>
5439
5439
</label>
5440
5440
<span data-translate="disable-host-chat">🚫🗨️ Disable the host chat and block functions </span>
5441
5441
</div>
5442
-
<div title="See documentation on socialstream.ninja for details.">
5442
+
<div title="Allows external apps (Python, Node, StreamDeck, etc.) to control SSN via HTTP/WebSocket API. Enable this to send commands like sendChat, blockUser, etc. to the extension.">
<span data-translate="remote-httpwss-api-control-extension">remote API control of extension</span>
5450
5450
</a>
5451
5451
</div>
5452
-
<div title="This is needed if HTTP/WSS commands are being sent to the dock for remote control, to bypass p2p if needed, and to publish featured messages via server instead of P2P">
5452
+
<div title="Connects the Dock/Featured pages to the API server for remote control. Needed if you want to send commands (clear, feature, nextInQueue, etc.) directly to the Dock via HTTP/WebSocket.">
<span data-translate="send-featured-chat-via-server-instead-of-p2p">Enable Dock to use and publish via API server</span>
5458
5458
</div>
5459
-
<div title="Mainly useful if P2P not working. It can also be used to send messages to the Dock via the API using channel 3/4">
5459
+
<div title="IMPORTANT: Enable this to receive chat messages via WebSocket API! Routes chat from Twitch/YouTube/etc. through the API server (channel 4) so external apps can listen. Required for Python/Node chat listeners.">
<span data-translate="send-messages-to-dock-via-server-instead-of-p2p">Send messages to Dock from Extension via server</span>
5464
+
<span data-translate="send-messages-to-dock-via-server-instead-of-p2p">📡 Send chat messages to API server (for external listeners)</span>
5465
5465
</div>
5466
-
<div title="Mainly useful if P2P not working in cases where you want to send messages to a social end point via the Dock page.">
5466
+
<div title="Allows the Dock page to send commands back to the extension via the API server instead of P2P. Useful if P2P connections are blocked or unreliable.">
Copy file name to clipboardExpand all lines: sampleapi.html
+25-20Lines changed: 25 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -197,7 +197,12 @@ <h1 class="mb-4">Social Stream API Sandbox</h1>
197
197
<pclass="lead">
198
198
This Social Stream API Sandbox is a comprehensive tool for developers to test and interact with the Social Stream Ninja API. It provides a user-friendly interface to experiment with various API features, including message generation, user management, and channel-specific communications. For full API documentation, please visit <ahref="https://socialstream.ninja/api" target="_blank">socialstream.ninja/api</a>.
199
199
<br/><br/>
200
-
Please note that you may need to add <b><i>&server</i></b> to the dock.html or featured.html pages if you wish to send messages to them via the API. By default the extension, nor any dock/overlay page, will connect to the API server by default; they must be configured to work with the API server via menu toggle or URL parameter.
200
+
<b>🎮 Remote Control (StreamDeck/Bitfocus):</b> Send commands like clear, nextInQueue, sendChat<br/>
201
+
→ Enable: <b>Toggle 1</b> (Enable remote API control) — Connect to <b>channel 1</b> (default)<br/><br/>
202
+
<b>📡 Chat Listener (Python/Node apps):</b> Receive chat messages from Twitch/YouTube/etc.<br/>
203
+
→ Enable: <b>Toggle 1 + Toggle 3</b> (Send chat messages to API server) — Connect to <b>channel 4</b><br/><br/>
204
+
<b>Settings Location:</b> Global settings > Mechanics<br/>
205
+
<small>Alternatively, add <b>&server</b> or <b>&server2</b> URL parameters to dock.html/featured.html pages.</small>
0 commit comments