This document provides an overview of the Social Stream Ninja (SSN) application, focusing on aspects relevant for AI integration, custom development, and API interaction.
Social Stream Ninja is an application designed to consolidate live social media messaging streams and provide various tools for streamers. It supports numerous platforms like Twitch, YouTube, Facebook, TikTok, and more, capturing chat messages, events, and donations. The system consists of a browser extension (or standalone app), a dock/dashboard page (dock.html), and various overlay pages (featured.html, actions.html, etc.). Communication between these components primarily uses WebSockets via VDO.Ninja’s infrastructure, but also supports direct HTTP/POST/SSE interactions.
streamID: A unique identifier for a user’s session. It’s crucial for connecting different components (dock, overlays, API clients) to the correct session. It’s typically auto-generated if not set.password: An optional password to secure the session connection.Messages within the SSN system generally follow a JSON object structure. Key fields often include:
id: Unique identifier for the message (often timestamp-based or incremental).type: Source platform (e.g., twitch, youtube, facebook).chatname: Display name of the user sending the message.chatmessage: The actual message content (can contain HTML or plain text).chatimg: URL of the user’s avatar.timestamp: Time the message was received or generated.hasDonation: String describing a donation amount/type (e.g., “$5.00”, “100 bits”).membership: Information about user membership/subscription status.event: Indicates if the message represents a stream event (e.g., “follow”, “viewer_update”). Regular chat messages must omit this field (or leave it empty/false) so they are never treated as system events.userid: Platform-specific user identifier.nameColor: User’s name color (if available/enabled).chatbadges: Array of badge URLs or objects representing user badges.contentimg: URL for attached images or videos in the message.karma: Sentiment score (if enabled).bot: Boolean indicating if the user is identified as a bot.mod: Boolean indicating if the user is identified as a moderator.host: Boolean indicating if the user is identified as the host.vip: Boolean indicating if the user is identified as a VIP.private: Boolean indicating if the message is private/direct.tid: Tab ID from which the message originated in the browser extension.The system captures various events beyond simple chat messages, such as follows, subscriptions, viewer count updates, donations, etc.. These often have an event field in the message structure.
SSN provides several HTML-based overlays:
dock.html: The main dashboard for viewing all incoming messages, managing queues, pinning messages, and controlling features.featured.html: An overlay designed to show one featured message at a time, often selected from the dock.actions.html: An overlay for handling specific actions triggered by points or commands (e.g., showing media).README.md).Customization:
&scale=, &compact, &font=, &speech=, &hidesource, &showtime=). Refer to popup.html code and README.md for examples.&css or &b64css URL parameters.SSN offers multiple ways for external applications or AI to interact with it.
wss://io.socialstream.ninjawss://io.socialstream.ninja/join/SESSION_ID/IN_CHANNEL/OUT_CHANNEL{"join": "SESSION_ID", "in": IN_CHANNEL, "out": OUT_CHANNEL}.https://io.socialstream.ninja/SESSION_ID/ACTION/TARGET/VALUEhttps://io.socialstream.ninja/SESSION_ID (with JSON body)https://io.socialstream.ninja/sse/SESSION_IDIN_CHANNEL: Specifies which channel(s) to listen to.OUT_CHANNEL: Specifies which channel to send messages to.sendChat: Sends a plain text message. {"action": "sendChat", "value": "message text", "target": "twitch"}sendEncodedChat: Sends a URL-encoded message.extContent: Ingests a fully formed message object (useful for external sources). {"action": "extContent", "value": "{JSON message object}"}clear, clearAll, clearOverlay: Clears messages from dock/overlay.nextInQueue: Advances the message queue.autoShow: Toggles auto-featuring messages.toggleTTS: Toggles text-to-speech.blockUser: Blocks a user. {"action": "blockUser", "value": {"chatname": "spammer", "type": "youtube"}}toggleVIPUser: Toggles VIP status for a user.getUserHistory: Requests message history for a user.target field in the JSON payload (or URL for GET) to specify a label assigned to a specific dock/overlay instance. {"action": "...", "target": "overlay1", "value": "..."}content2, content3, etc., to send directly to specific channels.background.js processes messages, applies bot actions (applyBotActions), filters, adds metadata.sendToDestinations sends messages via P2P (sendDataP2P) or WebSocket server (if configured) to docks, overlays, and potentially external APIs (POST/PUT/H2R/Singular).dock.html) receives messages, displays them, allows user interaction (clicking, queuing, pinning).featured.html, etc.) receive featured content or specific data (like waitlist updates) and display it.relayall (relays all messages - NOT RECOMMENDED due to spam potential) or relaydonos (relays only donation messages).relaytargets setting allows specifying which source types (e.g., twitch,youtube) should receive relayed messages.&speech=en-GB, &voice=google, &rate=1.2, &ttsprovider=elevenlabs, &elevenlabskey=API_KEY.toggleTTS action).!say).SSN includes many other features, such as:
points.js, pointsactions.js).ai.js).custom.js.README.md).Social Stream Ninja offers a robust system for managing multi-platform chat and events. For AI integration:
wss://io.socialstream.ninja with your SESSION_ID to send and receive messages/commands in real-time.extContent action to push messages from external AI sources into the SSN ecosystem.sendChat to send AI-generated responses back to specific chat platforms.content, clear, and other actions to control what’s displayed on featured overlays.target parameter for precise control in multi-instance setups.By understanding these components and APIs, an AI can effectively interact with and enhance the Social Stream Ninja experience.