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. To show that row, tap the version number at the
bottom of Settings 10 times.Share feedback with an in-app bug report, on
Discord, or by email at
help@glassly.ai.
DISPLAY_SURFACES in your
manifest. There is no OS prompt, and
the Store listing says “Keep a strip on the glasses display”. Its canonical key in
session.permissions is displaySurfaces.
Request a surface
requestSurface resolves to {status: "granted", surface} or
{status: "refused", reason}.
Only glasses that position and animate elements show surfaces (G2 on Glassly
firmware, simulated glasses). Elsewhere requests are refused and held surfaces
are hidden.
Draw and release
DisplaySurface has:
id, andstate:{id, edge, width, height, visible, maxTextElements, maxImageElements}, ornullonce ended.render(elements): the same elements asdisplay.render, in the surface’s own coordinates from 0,0 towidth×height. Awaited, it resolves once the glasses show it.onChange(handler): called with{surface, reason}, wherereasonis"resized","shown","hidden","replaced"or"released".surfaceisnullonce ended.release(): gives the edge back.
session.input.setClaimedGestures.
A double tap normally closes the miniapp on the main view before any claim is
read. While the running dashboard holds a surface and claims double_tap, the
tap goes to the dashboard instead and the miniapp beside the surface keeps
running, so a dock can use it to step out of the app (Glassly App 0.4.4 or
later; earlier ones close the miniapp). A surface held by any other miniapp leaves the
rule as it is. The Dock Dashboard
is a complete dashboard built on a left surface.
Every miniapp’s canvas shrinks
While surfaces show,session.capabilities.display.width, height,
maxTextElements and maxImageElements become the area beside them, and
session.onCapabilitiesChange fires. There is no opt-out. Read the canvas from
capabilities, never hard-code 576 × 288, and redraw on onCapabilitiesChange.
The host moves each miniapp’s frame into place, so you always draw from 0,0.
Boxes are clamped to your area. Point shapes and rotated elements that would
reach outside it are dropped and reported in dropped.
