ecmind-blue-dashlet

ecmind-blue-dashlet is a framework-agnostic core library for enaio dashlets: it handles environment detection (webclient / rich client / standalone), the init state machine, payload normalization, and the host wires — so a dashlet script never has to re-implement the enaio Dashlet API contract. Zero runtime dependencies; dual ESM + CJS output.

1. The three environments

Environment Where Wire

webclient

Dashlet in a sandboxed iframe inside the enaio webclient

window.postMessage — 3-element arrays + msgId correlation; onInit/onUpdate events

richClient

Dashlet in the embedded WebView2 of the Windows rich client

Injected window.osClient (synchronous osjx* bridge) plus the host-called global osDashletInit(data); no initial event — self-initialization

standalone

Plain tab, dev server, or any non-enaio embed

No bridge, no events — bounded degraded state (fallback, never a hang)

All three resolve the same init promise into the same normalized InitContext — dashlet code never branches on the environment except where host capabilities genuinely differ (the portable facade documents each difference explicitly).

2. The single rule

Call installDashletGlobal(options) first, at the top level of the dashlet script, before anything that could be deferred. The rich client fires its first window.osDashletInit without waiting for load — the library therefore installs its global synchronously at import time and buffers every host call that arrives before configuration.

Quickstart shows the minimal dashlet. For the full behavior of the init state machine, see Environments and detection.

3. Where to look