
Research
/Security News
Shai Hulud Strikes Again (v2)
Another wave of Shai-Hulud campaign has hit npm with more than 500 packages and 700+ versions affected.
@elgato-stream-deck/webhid
Advanced tools
An npm module for interfacing with the Elgato Stream Deck in the browser
@elgato-stream-deck/webhid is a shared library for interfacing
with the various models of the Elgato Stream Deck.
This library has nothing to do with the streamdeck software produced by Elgato. There is nothing here to install and run. This is a library to help developers make alternatives to that software
$ npm install --save @elgato-stream-deck/webhid
Since v7.0.0, the buffer polyfill is no longer been necessary. If you find that it is still needed somewhere, please report it as that is a bug.
On linux, the udev subsystem blocks access to the StreamDeck without some special configuration.
Copy the rules file into /etc/udev/rules.d/ and reload the rules with sudo udevadm control --reload-rules
Unplug and replug the device and it should be usable
down and key up eventsThe root methods exposed by the library are as follows. For more information it is recommended to rely on the typescript typings for hints or to browse through the source to see what methods are available
/**
* Request the user to select some streamdecks to open
* @param userOptions Options to customise the device behvaiour
*/
export async function requestStreamDecks(options?: OpenStreamDeckOptions): Promise<StreamDeckWeb[]>
/**
* Reopen previously selected streamdecks.
* The browser remembers what the user previously allowed your site to access, and this will open those without the request dialog
* @param options Options to customise the device behvaiour
*/
export async function getStreamDecks(options?: OpenStreamDeckOptions): Promise<StreamDeckWeb[]>
/**
* Open a StreamDeck from a manually selected HIDDevice handle
* @param browserDevice The unopened browser HIDDevice
* @param userOptions Options to customise the device behvaiour
*/
export async function openDevice(browserDevice: HIDDevice, userOptions?: OpenStreamDeckOptions): Promise<StreamDeckWeb>
The StreamDeck type can be found here
import { requestStreamDecks } from '@elgato-stream-deck/webhid'
// Prompts the user to select a streamdeck to use
const myStreamDecks = await requestStreamDecks()
myStreamDecks[0].on('down', (keyIndex) => {
console.log('key %d down', keyIndex)
})
myStreamDecks[0].on('up', (keyIndex) => {
console.log('key %d up', keyIndex)
})
// Fired whenever an error is detected by the hid device.
// Always add a listener for this event! If you don't, errors will be silently dropped.
myStreamDecks[0].on('error', (error) => {
console.error(error)
})
// Fill the first button form the left in the first row with a solid red color. This is asynchronous.
await myStreamDecks[0].fillKeyColor(4, 255, 0, 0)
console.log('Successfully wrote a red square to key 4.')
Some the demo site for some more complete examples and its corresponding source.
The elgato-stream-deck team enthusiastically welcomes contributions and project participation! There's a bunch of things you can do if you want to contribute! Please don't hesitate to jump in if you'd like to, or even ask us questions if something isn't clear.
Please refer to the Changelog for project history details, too.
FAQs
An npm module for interfacing with the Elgato Stream Deck in the browser
The npm package @elgato-stream-deck/webhid receives a total of 287 weekly downloads. As such, @elgato-stream-deck/webhid popularity was classified as not popular.
We found that @elgato-stream-deck/webhid demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Another wave of Shai-Hulud campaign has hit npm with more than 500 packages and 700+ versions affected.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.