Everything you need to integrate custom USB keypads, broadcast automation scripts, OBS plugins, and game telemetry into Kudoby Deck over sub-10ms WebRTC.
Connecting to a local Kudoby Deck daemon, registering custom event listeners, and updating key display titles dynamically:
// 1. Import the official Kudoby Deck SDK
import { KudobyDeckClient } from '@kudoby/deck-sdk';
const deck = new KudobyDeckClient({
host: '127.0.0.1',
port: 4455,
apiKey: process.env.KUDOBY_API_KEY
});
await deck.connect();
console.log('Connected to Kudoby Deck Core Engine v2.4');
// 2. Listen to physical or touch key presses
deck.on('key:press', async ({ keyIndex, pageId }) => {
console.log(`Key ${keyIndex} pressed on page ${pageId}`);
if (keyIndex === 0) {
// Switch OBS Scene
await deck.obs.setCurrentProgramScene('Gameplay Cam 1');
// Update button LED display dynamically
await deck.setKeyAppearance(0, {
title: 'LIVE ON AIR',
bgColor: '#ff007f',
textColor: '#ffffff',
badge: 'REC'
});
}
});
// 3. Listen to rotary encoder fader dials
deck.on('dial:rotate', async ({ dialIndex, delta }) => {
console.log(`Dial ${dialIndex} rotated by ${delta} steps`);
await deck.audio.adjustSourceVolume('Discord Chat', delta * 2);
});
Every key press sends an encrypted low-overhead JSON binary frame over local WebRTC DataChannels:
{
"v": 2,
"type": "ACTION_DISPATCH",
"sessionId": "creator_session_9104",
"payload": {
"target": "OBS_STUDIO_V5",
"method": "SetCurrentProgramScene",
"params": { "sceneName": "Intermission Screen" }
},
"timestamp": 1740000000042
}
The SDK is released under the MIT Open Source license. Contributions, pull requests, and custom driver plugins are welcomed on our official GitHub repository.