registerMiniapp
handler a session. It lives in the background layer, and every capability
(display, microphone, sensors, storage) is a module on it.
src/background/index.ts
session. (For advanced
or testing use you can new MiniappSession() and call connect() directly, but a
normal miniapp never needs to.)
Modules
Typesession. in your editor and autocomplete shows everything. Each module is
covered in its own page.
Output
Input & audio
Sensors & device
Phone & system
Storage & data
Glasses with cameras
Interop & UI
Lifecycle
Subscribe to lifecycle events withsession.on(event, handler). Each returns an
unsubscribe function.
Subscriptions
Registering a handler subscribes; calling the returned function unsubscribes. You never manage subscriptions by hand..on(), .onUpdate(), .onChunk(), .onButtonPress(), and the rest
return this cleanup function. Subscriptions are ref-counted internally: the SDK
only talks to the phone on the first subscribe and last unsubscribe of a given
stream.
A successful request means accepted, not done. For streaming capabilities,
watch the stream for the real result rather than assuming the call already
succeeded.
Properties
Next steps
Display
Show text and graphics on the glasses.
Transcription
Turn speech into text in real time.
Storage
Persist data across sessions.
Actions
Let Mentra AI call your miniapp.

