Guía de Desarrollador de Plataforma DejaOS
Publicado 2026-08-26
中ENDejaOS es la plataforma de sistema operativo de aplicaciones de Vguang para dispositivos inteligentes (sobre Linux personalizado, integrando QuickJS con el framework gráfico LVGL/dxUi). Esta guía cubre rutas de acceso, el subprotocolo Widget y ejemplos de API abierta en la nube.
DejaOS is Vguang’s application operating-system platform for smart devices, built on custom Linux and integrating QuickJS with LVGL/dxUi for graphics — letting developers build, deploy and iterate device-side business apps in JavaScript; try it live at dejaos.vguang.cn.
1. Developer access paths
① Cloud open API: org sync, bulk permission push, access/alarm log return — for platform-level integration; ② device-side Widget: embeds AI/interaction into the terminal UI, handshaking securely with the terminal via a WebSocket subprotocol.
2. Cloud open API (org-sync sample)
Create an enterprise space on the Vguang cloud platform to get the API Key and device-group ID; then push personnel and permissions via the "org sync" API. The sample below is an honest skeleton — fields per the open API docs:
```js // Pseudocode: org-sync bulk push (fields per open API docs) const res = await fetch(`${PLATFORM_BASE}/api/v1/org/sync`, { method: "POST", headers: { "Authorization": `Bearer ${API_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ groupId: DEVICE_GROUP_ID, users: [{ id, name, perm }] }) }); ```
3. Device-side Widget subprotocol (koodle.widget.v1)
The Widget handshakes with the terminal over WebSocket. The browser WebSocket API cannot set custom headers; the only channel to carry a credential at handshake is Sec-WebSocket-Protocol. The sample below shows negotiating koodle.widget.v1 — an honest skeleton:
```js // Pseudocode: handshake via subprotocol (token in subprotocol, not URL) const protocols = ["koodle.widget.v1", `kd-token.${btoa(urlSafe(TOKEN))}`]; const ws = new WebSocket("wss://dejaos.vguang.cn/widget", protocols); ws.onopen = () => console.log("subprotocol:", ws.protocol); // echoes koodle.widget.v1 ```
4. Integration notes
① Pass tokens via subprotocol, never in the URL (avoids access-log leakage); ② exact fields and token issuance follow the latest open-platform / product-manual docs; ③ debug end-to-end in a test space before switching to production.
5. Source & SDK repository
The DejaOS open-platform source, SDK and samples are hosted on GitHub: https://github.com/DejaOS/DejaOS . Grab the latest SDK, file issues and PRs, and join the ecosystem there.
Preguntas frecuentes
¿Qué es DejaOS?
La plataforma de sistema operativo de aplicaciones de Vguang para dispositivos inteligentes, basada en Linux personalizado e integrando QuickJS con el framework gráfico LVGL/dxUi, que permite a los desarrolladores crear, desplegar e iterar aplicaciones de negocio en JavaScript que se ejecutan en dispositivos inteligentes.
¿Qué rutas de acceso tienen los desarrolladores?
Dos: ① API abierta en la nube (sincronización, envío de permisos, registros); ② Widget en dispositivo vía subprotocolo WebSocket koodle.widget.v1.
¿Cómo se autentica el subprotocolo Widget?
En el handshake, el token koodle.widget.v1 y la credencial viajan por Sec-WebSocket-Protocol; el token exacto es el Widget Token de la plataforma abierta — pásalo por subprotocolo, no en la URL.
¿Dónde obtengo el código y el SDK?
Alojado en GitHub en https://github.com/DejaOS/DejaOS — obtenga el SDK, las muestras y la LICENSE más recientes y contribuya con issues / PRs.
