TL;DR
- Run
npm update @mentra/sdk - Your app still works (compat layer handles everything)
- Follow the steps below to adopt the new API when you’re ready
- The compat layer will be removed in v3.1 (minimum 8 weeks after v3.0)
What Changed (and Why)
MiniAppServer replaces AppServer.
Instead of subclassing AppServer and overriding onSession, you create a MiniAppServer instance and register callbacks. This is simpler, works better with TypeScript inference, and matches how most modern frameworks handle lifecycle hooks.
Session managers replace session.events.*.
Instead of one big events bag where everything is accessed via string-based method names, each capability is now its own manager on the session object. session.events.onTranscription(handler) becomes session.transcription.on(handler). This gives you autocomplete, type safety, and discoverability - you can explore session. and see everything available.
Some things were renamed to be clearer:
session.layouts→session.displaysession.audio→session.speaker(output only)session.simpleStorage→session.storage
session.mic- raw audio input and voice activity detectionsession.device- unified hardware state, events, WiFi, and capabilitiessession.phone- notifications, calendar, and phone batterysession.permissions- query and observe app permissionssession.time- timezone-aware time utilitiessession.translation- real-time translation (was deferred to v3.1, pulled into v3.0)
Step 1: AppServer → MiniAppServer
This is the biggest change. Your v2 app looks like this:- No class, no inheritance. Just create an instance and register callbacks.
onSessionreceives aMentraSession(notAppSession). No separatesessionIdanduserIdargs - they’re on the session object assession.sessionIdandsession.userId.onStopreceives the session and a reason string.app.start()returns a Promise. Useawaitor.then().
MiniAppServer extends the Hono app, so you can call app.get(), app.post(), app.use(), etc. directly:
getExpressApp() in v2, that’s gone. Express was removed. Use Hono’s routing API directly.
Step 2: session.events → session managers
Everysession.events.onSomething() call maps to a specific manager on the session.
Transcription
Translation
Phone Notifications
Calendar Events
Button Press / Touch Events
Glasses Connection State
Battery Updates
Step 3: session.layouts → session.display
All the same methods exist, just onsession.display instead of session.layouts:
ViewType and LayoutType enums are unchanged.
Step 4: session.audio → session.speaker
Audio output (playing sounds, TTS) moved tosession.speaker:
Step 5: session.simpleStorage → session.storage
Step 6: Other Renames
Step 7: Clean Up Deprecated Imports
After migrating your code, update your imports:What Didn’t Change
These things work exactly the same in v3:- Wire protocol - WebSocket messages, subscription strings, all unchanged
- Cloud behavior - The cloud handles v2 and v3 apps identically
- Webhook format - Same
/webhookendpoint, same payload.MiniAppServermounts both old and new paths. - Settings and capabilities - Same data, just accessed through managers
- Camera - Same API surface, accessed via
session.camera - LED - Same API, accessed via
session.led - Webviews - Same webview system,
@mentra/reactworks the same
New Features in v3
These are only available with the v3 API (not accessible through the compat layer):session.mic
Raw audio input from the glasses microphone:session.device
Unified device state with reactive Observables:session.phone
Phone state and events:session.permissions
Query what your app is allowed to do:session.time
Timezone-aware utilities:session.translation
Real-time translation with language targeting:Reconnection Callbacks
Know when a session reconnects after a transport blip:FAQ
Do I have to migrate right now? No. Your v2 app works on v3 without changes. Migrate when you’re ready. When is the compat layer removed? v3.1, which will be at least 8 weeks after v3.0 ships. We’ll announce with advance warning. Can I use v3 and v2 patterns in the same app? Yes. During the transition, you can mix old and new patterns. For example, useMiniAppServer with session.events.onTranscription() - it works.
What about my Express middleware?
Express was removed. MiniAppServer uses Hono. If you had custom Express middleware, rewrite it as Hono middleware. See the Hono documentation for the equivalent patterns.
I used session.events.on() as a generic escape hatch.
It still works in v3.0. The compat layer translates it to the appropriate manager subscription.
