How to Develop App Extensions¶
App extensions are sandboxed web projects that open in desktop APP tabs. They are the right choice when you need to:
- build custom UI inside Zelos
- visualize or control extension-specific workflows
- read typed bridge state such as theme and extension metadata
Create a project¶
Optional metadata and template controls:
zelos extensions create my-app-extension --type app \
--author "Jane Doe" \
--description "Custom dashboard for device health" \
--template react \
--template-ref v1.0.0
The created project is based on:
- official templates: https://github.com/zeloscloud/zelos-extension-templates/tree/main/app/react
- SDK package:
@zelos-cloud/app-extension-sdk
Develop standalone¶
Running the app in a normal browser tab uses the SDK MockBridge, so you can iterate without the desktop app.
Develop inside Zelos¶
For fast iteration:
Then reload or reopen the APP tab in Zelos.
Lifecycle note¶
App extensions are not process-managed like agent extensions. The usual app workflow is:
- build the web assets
zelos extensions install-local <path>- reopen or reload the APP tab
Agent lifecycle commands such as zelos extensions start, stop, restart, and
reinstall do not apply to app extensions.
Security note¶
Embedded app extensions run under a strict Content Security Policy:
- No external network -
fetch(),XMLHttpRequest, and form submissions tohttp:/https:URLs are blocked by CSP - Origin isolation - each extension runs under
zelos-app://extensionId, isolated from the host and other extensions - Iframe sandbox -
allow-scripts allow-same-originonly; no form submissions or popups
When developing standalone with MockBridge, standard browser CSP applies (typically unrestricted for localhost). External API access is only available in standalone mode.
Package and release¶
That builds the app and delegates archive creation to:
The generated extension.toml includes a [package] section that controls which files are included in the archive:
Use zelos extensions package --list . to preview the files before packaging.
Bridge and manifest essentials¶
A complete manifest for an app extension:
name = "My App Extension"
version = "0.1.0"
icon = "assets/icon.svg"
readme = "README.md"
[host]
type = "app"
[host.app]
kind = "web_app"
entry = "dist/index.html"
[package]
paths = ["dist"]
- Vite should use
base: "./"so assets resolve fromzelos-app://... - the initial host state arrives in
handshake-ack.snapshotasinfo,theme, andworkspace - after connect, the host only pushes
theme.changedandworkspace.changed - v1 has no request/response or host-command bridge API
ZelosBridgeProviderapplies Zelos light/dark theme classes and design tokens to the document automatically- optional host context is available through SDK hooks when your app needs it
- keep extension-owned UI state inside the extension; APP tabs may be reloaded or remounted across the desktop app lifecycle
More detail¶
- Shared extension concepts and broader reference: Develop Extensions
- Official app template: https://github.com/zeloscloud/zelos-extension-templates/tree/main/app/react
- SDK package:
@zelos-cloud/app-extension-sdk