session.device (the DeviceManager) gives your app access to everything about the connected glasses hardware. It exposes reactive state observables for battery, WiFi, and connection status, event handlers for buttons, gestures, and head position, and a capability profile describing what the current device supports.
All event handlers return a cleanup function. Call it to unsubscribe.
Quick Example
Reactive State
Every property onsession.device.state is an Observable. Read the current value with .value, or subscribe to changes with .onChange(cb). The onChange method returns a cleanup function.
Connection
| Observable | Type | Description |
|---|---|---|
state.connected | Observable<boolean> | Whether glasses are connected |
state.modelName | Observable<string | null> | Model name of the connected glasses |
Battery
| Observable | Type | Description |
|---|---|---|
state.batteryLevel | Observable<number | null> | Glasses battery level, 0 to 100 |
state.charging | Observable<boolean | null> | Whether the glasses are charging |
state.caseBatteryLevel | Observable<number | null> | Charging case battery level |
state.caseCharging | Observable<boolean | null> | Whether the case is charging |
state.caseOpen | Observable<boolean | null> | Whether the case lid is open |
state.caseRemoved | Observable<boolean | null> | Whether the glasses have been removed from the case |
WiFi and Hotspot
| Observable | Type | Description |
|---|---|---|
state.wifiConnected | Observable<boolean> | Whether WiFi is connected |
state.wifiSsid | Observable<string | null> | Connected WiFi network name |
state.wifiLocalIp | Observable<string | null> | Local IP address on the WiFi network |
state.hotspotEnabled | Observable<boolean | null> | Whether the hotspot is active |
state.hotspotSsid | Observable<string | null> | Hotspot network name |
Event Handlers
All event handlers follow the same pattern: pass a callback, get back a cleanup function.onButtonPress(handler)
Listen for physical button press events on the glasses.
| Field | Type | Description |
|---|---|---|
event.buttonId | string | Which button was pressed (e.g. "forward", "back", "select") |
event.pressType | "short" | "long" | Whether it was a short press or a long press |
onHeadPosition(handler)
Listen for head tilt events from the IMU. Fires when the user looks up or down past the threshold.
| Field | Type | Description |
|---|---|---|
event.position | "up" | "down" | Current head position |
onTouchEvent(handler) and onTouchEvent(gesture, handler)
Listen for touch and gesture events from the glasses touchpad. Call with just a handler to receive all events, or pass a gesture name to filter.
| Field | Type | Description |
|---|---|---|
event.gesture | string | Gesture name (e.g. "single_tap", "double_tap", "forward_swipe", "backward_swipe") |
event.model | string | Device model that produced the event |
event.timestamp | Date | string | When the gesture occurred |
subscribeToGestures(gestures)
Subscribe to multiple gesture types at once. Returns a single cleanup function that removes all subscriptions.
onTouchEvent handlers.
onBatteryUpdate(handler)
Listen for battery change events. This also updates the reactive state.batteryLevel and state.charging observables automatically.
| Field | Type | Description |
|---|---|---|
event.level | number | Battery level, 0 to 100 |
event.charging | boolean | Whether the glasses are charging |
onVpsCoordinates(handler)
Listen for Visual Positioning System (VPS) coordinate updates.
Capabilities
Thecapabilities property holds the current device capability profile. It is set when the glasses connect and updated if the device changes mid-session.

