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.glasses reports on the glasses hardware: battery level plus charging
state, connection state, and Wi-Fi state. All are subscriptions, so you get
a callback whenever the value changes.
src/background/index.ts
Battery
onBattery fires when the glasses report a new battery reading.
BatteryData has:
Connection
onConnection fires when the glasses connect or disconnect.
ConnectionData has:
modelName is optional, so guard for it before reading:
Wi-Fi
onWifi fires the current state on subscribe, then again on every change.
connected is false on glasses without Wi-Fi.
WifiData has:
requestWifiSetup(reason?) asks the host to open the glasses Wi-Fi setup flow
on the phone. reason is a user-facing line shown in the setup prompt.
Cleaning up
Every subscription method returns 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.
