Skip to content

Repository files navigation

StreamDeckPluginRust

Cross-platform Rust SDK for Elgato Stream Deck WebSocket plugins.

This repository is not a USB HID driver. Stream Deck Module / direct hardware protocols are out of scope. The SDK talks to the Stream Deck application over the official plugin WebSocket.

Protocol types were implemented independently. streamdeck-rs (Apache-2.0 / MIT) was used as a reference for device-type coverage and plugins that omit states.

Crates

Crate Purpose
streamdeck-plugin Actions, registry, dispatcher, logging, manifest checks. Depend on this.
streamdeck-plugin-protocol Registration, events, commands, optional Tokio transport
streamdeck-plugin-macros #[streamdeck_action] (re-exported by streamdeck-plugin)

Property Inspector bindings live in @mikanseilaboratory/streamdeck-pi-client.

Quick start

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    streamdeck_plugin::Plugin::builder(std::env::args())
        .state(AppState::default())
        .add_registered_actions()
        .run()
        .await?;
    Ok(())
}

#[derive(Default)]
struct CounterAction;

#[streamdeck_action(
    uuid = "dev.example.plugin.counter",
    settings = CounterSettings,
    state = AppState,
)]
impl KeypadAction for CounterAction {
    async fn on_key_down(
        &mut self,
        _p: &ActionPayload,
        ctx: &ActionContext<'_, Self::Settings, Self::State>,
    ) -> Result<()> {
        ctx.state().store.add(ctx.settings().increment.max(1));
        Ok(())
    }
}

Use EncoderAction for dials. Action is also public if you prefer to implement every handler by hand and call .add_action::<T>().

Sample

samples/counter-sample shows a keypad action and a Stream Deck + dial sharing one store, plus a React inspector.

./samples/counter-sample/publish.ps1 -Install -Pack

Documentation

License

Apache License 2.0

About

Rust StreamDeck Plugin SDK with PropertyInspector type generation

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages