WebSocket Plugin API
FreshOverview
The WebSocket API enables native console applications (C++, C#, etc.) to communicate with Stream Deck via dedicated WebSocket connections.
Registration
Plugins receive command-line parameters on launch:
| Parameter | Description |
|---|---|
-port | WebSocket server port |
-info | Serialized JSON with SD and plugin info |
-pluginUUID | Unique plugin identifier |
-registerEvent | Registration event name |
Registration Info Structure
The RegistrationInfo object contains:
- Application: font, language, platform (Mac/Windows), version
- Color preferences: button states, highlight colors
- Device pixel ratio: for high-DPI detection
- Connected devices: array with IDs, names, dimensions, types
- Plugin metadata: UUID and version
Events (Received by Plugin)
Device Events
| Event | Description |
|---|---|
DeviceDidConnect | Hardware connected |
DeviceDidDisconnect | Hardware disconnected |
DeviceDidChange | Device changed (SD 7.0+) |
User Input Events
| Event | Description |
|---|---|
KeyDown | Key pressed |
KeyUp | Key released |
DialDown | Dial pressed |
DialUp | Dial released |
DialRotate | Dial rotated |
TouchTap | Touch strip tapped |
Lifecycle Events
| Event | Description |
|---|---|
WillAppear | Action visible on canvas |
WillDisappear | Action removed from canvas |
PropertyInspectorDidAppear | PI opened |
PropertyInspectorDidDisappear | PI closed |
Data Events
| Event | Description |
|---|---|
DidReceiveSettings | Action settings received |
DidReceiveGlobalSettings | Global settings received |
DidReceiveResources | Resources updated |
DidReceiveSecrets | Secrets available |
DidReceivePropertyInspectorMessage | Message from PI |
System Events
| Event | Description |
|---|---|
ApplicationDidLaunch | Monitored app started |
ApplicationDidTerminate | Monitored app stopped |
SystemDidWakeUp | System woke from sleep |
TitleParametersDidChange | Title settings changed |
DidReceiveDeepLink | Deep link received |
Commands (Sent by Plugin)
| Command | Description |
|---|---|
GetSettings | Request action settings |
SetSettings | Persist action settings |
GetGlobalSettings | Request global settings |
SetGlobalSettings | Persist global settings |
SetImage | Update action image |
SetTitle | Update action title |
SetState | Toggle action state |
SetFeedback | Update dial layout values |
SetFeedbackLayout | Assign dial layout |
LogMessage | Write to log |
OpenUrl | Open URL in browser |
SendToPropertyInspector | Message to PI |
ShowAlert | Show warning indicator |
ShowOk | Show success indicator |
SwitchToProfile | Switch device profile |
Each command requires a context identifier and appropriate payload.