๐Ÿ“ก OBS Plugin + ๐ŸŽ› StreamDeck

WebSocket-Bridge zwischen OBS/StreamDeck und Codenull Backend. Hardware Control fรผr den Stream.

๐Ÿ’ก Zwei Module, eine Verbindung

๐Ÿ“ก OBS Plugin

Custom OBS Plugin (oder Lua Script) das eine WebSocket-Verbindung zu Codenull herstellt. OBS โ†’ Backend: Scene/Source Status, Stream Info. Backend โ†’ OBS: Scene Switch, Source Toggle, Filter Control.

  • Bidirektionale Kommunikation
  • OBS Events โ†’ Workflow Trigger
  • Workflow Actions โ†’ OBS Control
  • Custom Docks im OBS Panel

๐ŸŽ› StreamDeck Plugin

Elgato StreamDeck Plugin das รผber Codenull API kommuniziert. Hardware-Buttons fรผr: Scene Switch, Timer Control, Clip erstellen, Sound abspielen, Custom Actions.

  • API-Key Auth (kein OAuth nรถtig)
  • Konfigurierbare Actions pro Button
  • Visual Feedback (Icons, Status)
  • Multi-Action Support
๐Ÿ— Architektur
๐ŸŽ› StreamDeck
HTTP API Calls
โ†’
Codenull API
ORPC + API Key
โ†”
Redis
Events + Jobs
โ†”
WS Events
WebSocket Hub
โ†”
๐Ÿ“ก OBS Plugin
WebSocket Client
StreamDeck โ†’ API (Request/Response) ยท OBS โ†” WebSocket (Bidirektional, Real-Time)

OBS: WebSocket Client

OBS Plugin verbindet sich zu wss://ws.codenull.de. Auth per API-Key im Header. Persistent Connection mit Auto-Reconnect.

StreamDeck: HTTP API

StreamDeck Plugin macht REST Calls zu https://media.codenull.de/rpc/.... API-Key Auth. Kein WebSocket nรถtig โ€” Request/Response reicht.

Shared: Workflow Actions

Beide nutzen dieselben Workflow Actions. StreamDeck-Button = "Execute Action X". OBS Event = Workflow Trigger. Alles รผber die Engine.

๐Ÿ“ก OBS Plugin โ€” Detail

Was OBS sendet und was es empfรคngt

OBS โ†’ Codenull (Events)

SEND obs.scene.changed
{ scene: "Gaming", prev: "Just Chatting" }
SEND obs.streaming.started
{ output: "srt://stream.codenull.de:8890" }
SEND obs.streaming.stopped
{ duration: 7234 }
SEND obs.recording.started
{ path: "D:/recordings/2026-03-18.mkv" }
SEND obs.source.muted
{ source: "Mikrofon", muted: true }
SEND obs.source.visibility
{ source: "Webcam", visible: false }
SEND obs.stats
{ fps: 60, cpu: 12.3, kbps: 6000, dropped: 0 }

โ†’ Alles = Workflow Trigger

Scene Switch โ†’ Auto-Mute Mic. Stream Start โ†’ Discord Notification. Recording Stop โ†’ Auto-Upload. CPU > 80% โ†’ Alert.

Codenull โ†’ OBS (Commands)

RECV obs.scene.switch
{ scene: "BRB Screen" }
RECV obs.source.toggle
{ source: "Webcam", visible: true }
RECV obs.source.mute
{ source: "Desktop Audio", muted: true }
RECV obs.filter.toggle
{ source: "Webcam", filter: "Blur", enabled: true }
RECV obs.source.settings
{ source: "Text", settings: { text: "BRB 5min" } }
RECV obs.transition.trigger
{ transition: "Stinger", duration: 500 }
RECV obs.screenshot
{ source: "Game Capture", format: "png" }

โ†’ Alles = Workflow Action

Donation > โ‚ฌ50 โ†’ Scene Switch zu "Thank You" fรผr 10s. Raid > 100 โ†’ Stinger Transition. Chat Command โ†’ Toggle Webcam.

๐Ÿ”ง OBS Plugin โ€” Implementation

โ†’ OBS Bridge im Codenull Client

Die OBS Bridge lรคuft als Background Service im Codenull Client (ehemals Desktop Editor). Der Client wird zu einer vollwertigen Streaming-Companion App umgebaut. Die Bridge hรคlt zwei WebSocket-Verbindungen: eine zu OBS (ws://localhost:4455 via obs-websocket-js) und eine zu Codenull (wss://ws.codenull.de). Events werden bidirektional weitergeleitet.

OBS โ†obs-websocketโ†’ Codenull Client (Bun Background Service) โ†WebSocketโ†’ Codenull Backend

๐Ÿ–ฅ Codenull Client (ehemals Desktop Editor)

Rename + Erweiterung. Der Client wird zur zentralen Streaming-Companion App:

Codenull Client (Electrobun) โ”œโ”€โ”€ Editor UI โ€” Video/Audio Player + Clip Export (wie jetzt) โ”œโ”€โ”€ Settings โ€” API Key, OBS Verbindung, Auto-Start โ””โ”€โ”€ Background Service โ”œโ”€โ”€ OBS Bridge โ€” obs-websocket โ†” Codenull WS โ”œโ”€โ”€ Tray Icon โ€” Status: Connected / Disconnected / Error โ””โ”€โ”€ Auto-Start โ€” Startet mit Windows, immer verbunden
๐Ÿ“‹ OBS Custom Docks

Browser Docks die in OBS eingebettet werden (View โ†’ Docks โ†’ Custom Browser Docks)

๐Ÿ“‹ Events Filter โ–พ
Follow NewViewer123 2s
Sub T1 xXGamerXx 15s
โ‚ฌ25 DankDonator 1m
Raid 87 FriendlyStr 3m
โฑ Timers + New
๐Ÿ† Subathon 04:23:12
โฑ Stream 02:34:56
๐Ÿ’€ Deaths 42
๐ŸŽฌ Quick Actions
๐Ÿ’ฌ Chat Twitch
Mod1: Willkommen!
xXGamer: GG das war nice
Sub42: LUL LUL LUL
๐Ÿ“Š Viewer Stats
๐Ÿ‘ Viewers 234
๐Ÿ“ˆ Peak 312
๐Ÿ’ฌ Chat/min 18
๐Ÿ‘ค New Follows +23
๐ŸŽจ Overlay
๐Ÿ”” Alerts
๐Ÿ’ฌ Chat Widget
๐Ÿ“Š Sub Goal
6 Docks als Browser Panels in OBS. URLs: https://codenull.de/obs/{dock}?token=xxx ยท Auth per API-Key Token
๐ŸŽ› StreamDeck Plugin โ€” Detail

Hardware-Buttons fรผr alle Codenull Actions

Button Actions

๐ŸŽฌ Scene

  • Switch Scene
  • Toggle Source
  • Mute/Unmute

โฑ Timer

  • Start/Stop/Pause
  • Counter +/-
  • Subathon Toggle

๐ŸŽฌ Media

  • Create Clip
  • Screenshot
  • Play Sound

๐Ÿ’ฌ Chat

  • Send Message
  • Run Command
  • Clear Chat

๐Ÿ”” Overlay

  • Toggle Widget
  • Test Alert
  • Mute Alerts

โšก Custom

  • Execute Workflow
  • HTTP Request
  • Multi-Action

StreamDeck Preview

๐ŸŽฎGaming
๐Ÿ’ฌChat
โ˜•BRB
๐Ÿ”ดEND
๐ŸŽตMusic
๐Ÿ”‡Mute Mic
๐Ÿ“ทWebcam
โœ‚๏ธClip
๐Ÿ“ธScreen
๐Ÿ””Test Alert
โฑTimer
๐Ÿ’€Death +1
๐Ÿ†Subathon
๐Ÿ“ŠGoal
โšกCustom

Visual Feedback

Buttons zeigen Status: Mic Muted = rotes Icon, Scene Active = grรผner Rand, Timer laufend = Countdown auf Button, Subathon = verbleibende Zeit.

๐Ÿ”ง StreamDeck โ€” Implementation

Elgato SDK

  • StreamDeck SDK v6 (JavaScript/TypeScript)
  • Plugin lรคuft als Node.js Prozess
  • Property Inspector: Konfiguration per Button
  • Dynamic Images: Icon-Updates basierend auf Status
  • @elgato/streamdeck npm Package

Codenull API Client

  • API-Key aus Admin Panel (Settings โ†’ API Keys)
  • HTTP Calls zu ORPC Endpoints
  • Optional: WebSocket fรผr Live-Status Updates
  • Retry + Error Handling
  • Shared Types mit Backend (@codenull/shared)
๐Ÿ”‘ API-Key System (Shared)

Fรผr OBS Bridge + StreamDeck + externe Integrationen

apiKey id text PK userId text FK // Owner name text // "OBS Bridge", "StreamDeck", "Custom Integration" key text unique // cnk_xxxxxxxxxxxxxxxx (hashed in DB) permissions text[] // ["obs.scene.switch", "timer.*", "clip.create"] lastUsedAt timestamp? expiresAt timestamp? // null = never expires isActive boolean createdAt timestamp

๐Ÿ” Scoped Permissions

Jeder Key hat nur die Rechte die er braucht. OBS Bridge: obs.*. StreamDeck: obs.*, timer.*, clip.create. Kein Master-Key nรถtig.

๐Ÿ”„ Key Management

Erstellen, Rotieren, Lรถschen im Admin Panel (Settings โ†’ API Keys). Letzter Zugriff wird geloggt. Ablaufdatum optional.

๐Ÿ“Š Usage Tracking

Requests pro Key zรคhlen. Rate Limiting pro Key (z.B. 100 req/min). Anomalie-Erkennung bei ungewรถhnlich vielen Requests.

โœ… Entscheidungen

Geklรคrt am 2026-03-18

1. OBS Bridge im Codenull Client

Kein separates Plugin, kein Lua, kein C++. Die OBS Bridge ist ein Background Service im Codenull Client (Electrobun). Nutzt obs-websocket-js. Tray Icon zeigt Verbindungsstatus. Auto-Start mit Windows.

2. Alle StreamDeck Modelle

Standard (15 Keys), Mini (6 Keys), XL (32 Keys), Plus (8 Keys + 4 Dials + Touchscreen), Mobile App. Elgato SDK v6 unterstรผtzt alle Modelle mit einem Plugin.

3. 6 OBS Docks

Events, Timers, Quick Actions, Chat, Viewer Stats, Overlay Control. Alle als Browser Docks รผber codenull.de/obs/{dock}?token=xxx. Auth per API-Key.

4. Desktop Editor โ†’ Codenull Client

Rename der App. Der Client wird zur zentralen Streaming-Companion App: Editor + OBS Bridge + Tray + Auto-Start. Ein Installer fรผr alles.

Codenull Platform ยท OBS Plugin + StreamDeck Module Planning ยท 2026-03-18