Upgrading to v2
FreshInstallation
bash
npm i @elgato/streamdeck@latestBreaking Changes
1. UI Namespace Simplification
Sending messages:
typescript
// Before (v1)
streamDeck.ui.current?.sendToPropertyInspector(data);
// After (v2)
streamDeck.ui.sendToPropertyInspector(data);Accessing actions:
typescript
// Before (v1)
const action = streamDeck.ui.current;
// After (v2)
const action = streamDeck.ui.action;2. Dependencies Decoupled
Some imports moved from @elgato/streamdeck to @elgato/utils:
| Import | Old Package | New Package |
|---|---|---|
JsonObject, JsonPrimitive, JsonValue | @elgato/streamdeck | @elgato/utils |
Enumerable, EventEmitter, EventsOf | @elgato/streamdeck | @elgato/utils |
LogLevel change:
typescript
// Before (v1)
LogLevel.TRACE
// After (v2)
"trace" // string literal3. Manifest Access Removed
The manifest is now a protected resource (DRM). Direct runtime access via streamDeck.manifest no longer exists.
4. Browser Import Eliminated
Importing @elgato/streamdeck into Property Inspector HTML is no longer supported.
Migration Checklist
- [ ] Update package:
npm i @elgato/streamdeck@latest - [ ] Replace
streamDeck.ui.current?.withstreamDeck.ui. - [ ] Replace
streamDeck.ui.currentwithstreamDeck.ui.action - [ ] Move JSON types to
@elgato/utils - [ ] Replace
LogLevel.Xwith string literals - [ ] Remove any
streamDeck.manifestusage - [ ] Remove
@elgato/streamdeckimports from PI HTML