Skip to main content
Mentra Miniapp SDK betaThe SDK is in beta, so its APIs may change before general availability.There is currently no way to distribute a miniapp built with the Miniapp SDK. In a future release, developers will upload miniapps through the Mentra Developer Console, and users will download them from the Mentra Miniapp Store. Neither service supports Miniapp SDK distribution in MentraOS 3.0.Only use the Miniapp SDK if you are comfortable with these limitations.Developing on Mentra Live? We recommend using the Mentra Bluetooth SDK.The developer tools are available in the Mentra App under Settings → Miniapp Developer Settings.Share feedback with an in-app bug report, on Discord, or by email at help@mentra.glass.
session.glasses reports on the glasses hardware: battery level plus charging state, and whether the glasses are connected. Both are subscriptions, so you get a callback whenever the value changes.
src/background/index.ts
There’s no synchronous getter for the current value. You learn the state by subscribing and waiting for the first event.

Battery

onBattery fires when the glasses report a new battery reading.
Each BatteryData has:

Connection

onConnection fires when the glasses connect or disconnect.
Each ConnectionData has: modelName is optional, so guard for it before reading:

Cleaning up

Both methods return an unsubscribe function:
session.glasses covers the glasses hardware. The phone has its own battery and connection events on session.phone. For what the connected glasses can do (display, camera, sensors), read session.capabilities once the session is ready.