Files
UNITRONIX dd0889e3d6 Add SessionManager; update docs, i18n & CI
Introduce a SessionManager for relay-based remote sessions in the Tauri MGMT client: new SessionCommand API, start/stop/session input routing, clipboard/recording/quality controls, and notification read/dismiss state. Wire AppState with new mutexes and show main window on startup. CI: add SBOM generation (anchore) and Trivy vulnerability scan steps. Misc: change console Docker DB path, large README/CHANGELOG updates (chat E2E, unattended access/WOL, i18n expansion, CDAP/SDK docs), and many web-nodejs assets/locales/routes/views/services and server-side changes.
2026-04-05 13:42:07 +02:00

2.2 KiB

BetterDesk SDK Overview

The BetterDesk SDK enables developers to build custom CDAP agents and bridges that integrate with the BetterDesk management platform.

Available SDKs

SDK Language Package Directory
Python Python 3.8+ betterdesk-cdap sdks/python/
Node.js Node.js 18+ betterdesk-cdap sdks/nodejs/

Architecture

Your Application Code
        │
        ▼
┌─────────────────┐
│  BetterDesk SDK │    CDAPBridge class handles:
│  (Python/Node)  │    - WebSocket connection management
│                 │    - Authentication
│  CDAPBridge     │    - Manifest registration
│  Widget         │    - Heartbeat loop
│  Message        │    - Reconnection with backoff
└────────┬────────┘    - Message serialization
         │
    WebSocket
         │
         ▼
┌─────────────────┐
│  BetterDesk     │
│  Go Server      │
│  CDAP Gateway   │
│  (:21122/cdap)  │
└─────────────────┘

Key Concepts

CDAPBridge

The main class. Manages the WebSocket connection, authentication, and message loop. Override methods like on_connected(), on_command(), and collect_metrics() to implement your agent logic.

Widget

Widgets define the UI elements that appear in the BetterDesk web console for your device. Each widget has a type (gauge, toggle, button, etc.), an ID, and configuration. Use factory methods: Widget.gauge(), Widget.toggle(), Widget.button(), etc.

Capabilities

Capabilities declare what your agent can do. Only declare capabilities you actually support. The server uses capabilities to enable/disable UI features for your device.

Getting Started

  1. Choose your language (Python or Node.js)
  2. Install the SDK package
  3. Create a CDAPBridge subclass (Python) or instance (Node.js)
  4. Define widgets for your device
  5. Implement command handlers
  6. Connect and run

See language-specific guides: