mirror of
https://github.com/UNITRONIX/BetterDesk.git
synced 2026-09-10 01:27:11 +00:00
Page:
SDK
Pages
API Reference
Alpha Software Notice
CDAP
Chat E2E
Client Generator
Client Setup
Configuration
Desktop Clients
Desktop Dashboard
Docker
FAQ
Fleet and Policies
Home
Installation
LDAP AD
Licensing
MeshAgent
Migration
Monitoring
OIDC SSO
Organizations and RBAC
Panel Updates
Privacy
SDK
Security
TLS SSL
Troubleshooting
UX 3.5
Unattended and WoL
User Management
Web Console
Web Remote
Clone
2
SDK
UNITRONIX edited this page 2026-09-06 12:21:21 +02:00
Table of Contents
SDK
Audience: developers building CDAP agents/bridges. Not required for a normal RustDesk + panel install.
Python and Node.js helpers for the CDAP gateway (:21122). Repo detail: docs/sdk/.
Architecture
Your application
│
▼
CDAPBridge (SDK) ── WebSocket ──► Go server :21122/cdap
│ │
Widgets / metrics / commands ▼
Web Console (CDAP pages)
Python SDK
Package: betterdesk-cdap · Requires: Python 3.8+
pip install betterdesk-cdap
from betterdesk_cdap import CDAPBridge, Widget
bridge = CDAPBridge(
server="ws://your-server:21122/cdap",
api_key="your-api-key",
device_id="SENSOR-001",
device_name="Temperature Sensor",
device_type="sensor",
)
bridge.add_widget(Widget.gauge("temperature", "Temperature", unit="°C", min=-20, max=50))
bridge.add_widget(Widget.toggle("heater", "Heater"))
@bridge.on_command("heater")
async def on_heater(action, params):
return {"success": True}
bridge.set_value("temperature", 22.5)
await bridge.connect()
Source: sdks/python/
Node.js SDK
Package: betterdesk-cdap · Requires: Node.js 22+
npm install betterdesk-cdap
const { CDAPBridge, Widget } = require('betterdesk-cdap');
const bridge = new CDAPBridge({
server: 'ws://your-server:21122/cdap',
apiKey: 'your-api-key',
deviceId: 'SENSOR-001',
deviceName: 'Temperature Sensor',
deviceType: 'sensor',
});
bridge.addWidget(Widget.gauge('temperature', 'Temperature', { unit: '°C' }));
bridge.setValue('temperature', 22.5);
bridge.connect();
Source: sdks/nodejs/
Key concepts
| Concept | Description |
|---|---|
| CDAPBridge | WebSocket client — auth, heartbeat, reconnect |
| Widget | UI element rendered in panel (gauge, toggle, button, …) |
| Manifest | Device capabilities sent on connect |
| Command | Panel → device action with response |
Enable CDAP on the server: -cdap flag or CDAP_ENABLED=Y.
Reference bridges
Pre-built protocol bridges in the repo:
| Bridge | Protocol |
|---|---|
bridges/modbus/ |
Modbus TCP/RTU |
bridges/snmp/ |
SNMP v2c/v3 |
bridges/rest-webhook/ |
REST polling + webhooks |
See also
- CDAP — wire protocol and gateway
- Web Console — CDAP Studio and device pages
- SDK overview
Start
Console
- Web Console
- User Management
- Organizations and RBAC
- LDAP / Active Directory
- OIDC SSO
- Client Generator
- Fleet and Policies
- Unattended Access and WoL
- Web Remote Desktop
- UX 3.5
Ops
Help
Advanced
- API Reference
- CDAP
- SDK
- Alpha Software Notice
- Desktop Clients
- MeshAgent
- Chat E2E Encryption
- Licensing
Source: docs/wiki/
Repository · Issues · Discussions · Releases · Privacy · Sponsors
Wiki source: docs/wiki/ — last sync: 2026-09-06