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.
Every miniapp has a miniapp.json at its root. It declares who the miniapp is, where its two layers are built to, what permissions it needs, and what hardware it requires. The CLI validates it on every dev, pack, and release: bad values fail on your laptop, not on the phone. The permission and hardware values it accepts come from the @glassly/miniapp version your project installs, so upgrade the SDK to declare a newly added one; a project on an SDK too old to provide that list gets an upgrade message.
miniapp.json

Fields

packageName, version, name, and hardwareRequirements are required. Everything else is optional. The $schema line points editors at the JSON Schema shipped with the CLI, so you get autocomplete and validation as you type. @glassly/create-miniapp adds it for you; you can also print the schema with glassly schema print.

Sandboxed web guests

A miniapp can use the host without declaring an import source. A catalogue can also attribute a conventional miniapp without using a web guest. A second source can supply its own display name, tag, adapter and optional glasses model. For protocol 1, the reviewed ui/guest.html wrapper owns its guest sandbox and source SDK translation. Use a frame with sandbox="allow-scripts" and a content security policy suited to an offline app. The wrapper sends JSON via window.ReactNativeWebView.postMessage. Send {kind:"init", token} on load, then {kind:"call", token, id, method, data} for requests. Choose a random token for each document and an integer ID for each request. The host routes these messages to the installed miniapp’s background on guest.call. The wrapper receives background messages through window.__host.recv(frame). Match the channel, token and ID before passing a reply into the sandbox. An adapter can use session.ui.send("guest.result", payload) for replies and events. Keep source SDK credentials and the general native bridge out of the frame.

Always On miniapps

Set "alwaysOn": true for a miniapp intended to keep running, such as an assistant or notification listener. The host starts it at launch; dismissing its app switcher card or closing its UI leaves the background running. Only Always On miniapps start at launch: one that merely happened to be running when the Glassly App closed comes back stopped. The wearer can stop it from the switcher’s Always On controls, and their per-miniapp Always On choice overrides the manifest default. Always On does not grant system privileges or prevent explicit stops. Use alwaysOn, not the earlier persistent or alwaysRun fields. type: "dashboard" makes a miniapp eligible to hold the dashboard role: one dashboard runs at a time, and the running one holds it. Starting a dashboard stops the one running and makes it the one Always On dashboard (last opened wins). It grants no privileges by itself. A dashboard that needs to list or start miniapps or edit platform settings declares MANAGE_MINIAPPS and PLATFORM_SETTINGS like any other miniapp.

Permissions

Each entry is { "type": "...", "required"?: boolean, "description"?: "..." }. The optional description is shown to the user in the OS permission prompt. Every permission is asked when the miniapp launches, the required ones first. The miniapp doesn’t open until the user grants those. "required": false makes one optional: it’s asked after the required ones, the user can skip it, and the miniapp opens either way. An optional permission stops being asked at launch once the user has answered its OS prompt.
Declaring a permission is not the same as the user granting it. session.permissions.has(type) reports what you declared in the manifest, not the live OS grant. If the user denied the OS prompt, your subscriptions receive nothing. See Permissions.

Hardware requirements

Each entry is { "type": "...", "level": "...", "description"?: "..." }.
  • REQUIRED: glasses without this hardware can’t install the miniapp (it’s hidden in the Glassly Miniapp Store and launcher on incompatible devices).
  • OPTIONAL: incompatible glasses still run the miniapp, in a degraded state.
MICROPHONE means that the miniapp needs audio input. Glassly satisfies this requirement with the connected glasses microphone when one is available and falls back to the phone microphone otherwise. A miniapp that requires audio is therefore compatible with glasses that have no onboard microphone.

Actions

Each entry is { "id": "...", "description": "...", "visibility"?: "...", "parameters"?: {...}, "outputSchema"?: {...} }. visibility is "public" by default, meaning any installed miniapp can invoke the action; "system" restricts it to system miniapps such as Glassly AI, which also hides it from session.actions.list() for everyone else.
See Interop & Actions for the full field rules and how to handle a call.

Widgets

Each entry is { "id": "...", "name": "...", "sizes": [...], "defaultSize"?: "..." }. It declares a card your miniapp can put on the glasses dashboard.
id is unique within the miniapp (^[a-z][a-z0-9_]*$, at most 64 characters), sizes is a list without repeats from XS, XSM, SM, MD, LG and EX with at least one card size, defaultSize must be one of its card sizes, the first when omitted, and EX lets a tap open the widget full screen (the wearer can turn that off per widget). Declaring a widget needs no permission. Serving one is covered in Provide a dashboard widget. Hosting other miniapps’ widgets needs HOST_WIDGETS.

Settings

Declare settings and the Glassly App shows them on your miniapp’s page (long-press the icon, then Miniapp info). The wearer changes them there, the host stores the values, and your miniapp reads them through session.appSettings.
type is toggle, select, slider, text or group. A group is a heading with a title. Every other type needs a key (^[a-z][a-zA-Z0-9_]*$, at most 64 characters, unique within the miniapp) and a label, and may carry a description. A select lists options as {label, value} pairs with string values. A slider needs min and max and takes step and a suffix. defaultValue is the value until the wearer or the miniapp sets one. A manifest holds at most 40 entries, and declaring settings needs no permission.
set(key, value) stores a value from your own phone page, and seed(values) hands over preferences you already keep in session.storage without overwriting what the wearer chose.

Editing the manifest

You can edit miniapp.json by hand, or use the CLI’s guided commands:
See the CLI reference for all of them.