MentraSession. This is your connection to that user - everything you do with their glasses goes through it.
Managers
Every capability on the glasses is accessed through a manager on the session object. Typesession. in your editor and autocomplete will show you everything available.
Input
| Manager | Access | What it does |
|---|---|---|
| Transcription | session.transcription | Real-time speech-to-text. Subscribe to all languages or filter by language. Configure diarization and language hints. |
| Translation | session.translation | Real-time translation. Subscribe to all translations or filter by target language. |
| Mic | session.mic | Raw audio chunks from the microphone and voice activity detection. Independent from transcription - subscribing to one does not give you the other. |
| Location | session.location | GPS coordinates. Get the latest location or subscribe to updates. |
Output
| Manager | Access | What it does |
|---|---|---|
| Display | session.display | Show text, text walls, double text walls, reference cards, and bitmaps on the glasses HUD. |
| Speaker | session.speaker | Play audio files, text-to-speech, and stream audio in real time. |
| LED | session.led | Control the LED light on supported glasses. |
| Dashboard | session.dashboard | Write to the system dashboard view (the screen users see when they look up). |
Device & State
| Manager | Access | What it does |
|---|---|---|
| Device | session.device | Hardware state (battery, model, connection), button/touch events, WiFi, and device capabilities. All state values are reactive Observables. |
| Phone | session.phone | Phone notifications, calendar events, and phone battery. Sub-scoped: session.phone.notifications and session.phone.calendar. |
| Permissions | session.permissions | Check what your app is allowed to do. Query individual permissions or get all of them. Subscribe to changes. |
Utilities
| Manager | Access | What it does |
|---|---|---|
| Storage | session.storage | Persistent key-value storage for your app. Data survives across sessions. |
| Time | session.time | Timezone-aware time utilities. Get the current time in the user’s timezone, format dates, access the timezone string. |
Lifecycle
A session goes through these states:- Connected -
onSessionfires. The user opened your app. - Running - Your code is active. Subscriptions are delivering data.
- Transport down - The WebSocket connection dropped briefly (network blip, cloud deploy). Your session stays alive. Subscriptions are preserved.
- Reconnected - The connection was restored.
session.onReconnected()fires. No action needed - everything resumes automatically. - Stopped - The session ended (user closed the app, or the grace period expired).
session.onStopped()fires.
Subscriptions
When you register a handler on a manager, the SDK automatically subscribes to the right data stream. When you remove the handler, it unsubscribes. You never manage subscriptions manually..on(), .forLanguage(), .to(), .onUpdate(), .onChange(), .onChunk(), etc. returns a cleanup function. Call it when you’re done.
Properties
| Property | Type | Description |
|---|---|---|
session.userId | string | The user’s ID |
session.sessionId | string | Unique ID for this session instance |
session.logger | Logger | Pino logger scoped to this user. Use session.logger.info(...) for per-user logging. |
session.settingsData | AppSettings | Current app settings from the user |
session.mentraosSettings | Record<string, any> | MentraOS system settings |
session.appConfig | AppConfig | null | Your app’s configuration from the developer console |
session.capabilities | Capabilities | null | What the connected glasses can do (display, camera, microphone, etc.) |
Multiple Users
Your app serves many users at once. Each user gets their ownMentraSession with isolated state:
Next Steps
Transcription
Capture and process speech in real time
Display
Show text and graphics on the glasses
Camera, Photos, And Streaming
Use the standalone Bluetooth SDK for camera workflows
Device
Hardware state, capabilities, and events

