Glassly Miniapp SDK betaThe SDK is in beta, so its APIs may change before general availability.Developing on Mentra Live? We recommend using the Glassly Bluetooth SDK.The developer tools are available in the Glassly App under Settings → Miniapp Developer Settings.Share feedback with an in-app bug report, on Discord, or by email at [email protected].
session.mirror reads the current intended glasses display, including content from other miniapps and the active dashboard or notification overlay. Declare DISPLAY_MIRROR in your manifest:

Query and subscribe

Query first and handle rejection when supporting older hosts, which do not recognize the request. Missing DISPLAY_MIRROR rejects getCurrent() with PERMISSION_NOT_DECLARED. Subscriptions are fire-and-forget: an undeclared subscription receives no frames. Additional listeners receive the SDK’s cached current snapshot. When combining asynchronous queries and a stream, ignore older revision values so a delayed query cannot replace a newer frame.

Snapshot contents

MirrorSnapshot is serializable and includes: Scene elements are ordered and processed by the host, with stable ids, resolved coordinates, and pre-wrapped text. Check content.kind before reading its variant’s fields.

Render in the phone UI

Send snapshots over the two-layer message bus. The background has no DOM; the canvas belongs in your WebView:
MirrorCanvas is also exported from @glassly/miniapp/react. It paints green ink on a transparent canvas and sizes to its container. For non-React UIs, import MirrorCanvasRenderer from @glassly/miniapp/mirror, construct it with an HTML canvas, call update(frame), and call dispose() on teardown. The mirror shows output after host arbitration and processing, before hardware presentation confirmation. It cannot read screenshots from the glasses. Known native dashboard/navigation handoffs report unavailable; firmware changes the host does not hear about cannot be detected. Browser fonts can differ from the glasses, and the preview is flat without stereo disparity. Continuous scenes animate locally; initial snapshots, epoch changes, and skipped frames snap to their target pose.