Skip to main content
Mentra Miniapp SDK betaThe SDK is in beta, so its APIs may change before general availability.There is currently no way to distribute a miniapp built with the Miniapp SDK. In a future release, developers will upload miniapps through the Mentra Developer Console, and users will download them from the Mentra Miniapp Store. Neither service supports Miniapp SDK distribution in MentraOS 3.0.Only use the Miniapp SDK if you are comfortable with these limitations.Developing on Mentra Live? We recommend using the Mentra Bluetooth SDK.The developer tools are available in the Mentra App under Settings → Miniapp Developer Settings.Share feedback with an in-app bug report, on Discord, or by email at help@mentra.glass.
When your miniapp connects, the SDK hands your 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
You don’t create or connect the session yourself. The host does it and runs your handler. Everything you do with the glasses goes through session. (For advanced or testing use you can new MiniappSession() and call connect() directly, but a normal miniapp never needs to.)

Modules

Type session. 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 with session.on(event, handler). Each returns an unsubscribe function.
session.capabilities, session.userId, and the user’s permissions are populated from the connect handshake, which lands after your handler first runs. Subscribe to events immediately, but read capabilities inside session.on("ready", …) (or session.onCapabilitiesChange). It’s null before then.
If the background context crashes, the host respawns it and re-runs your handler with backoff. See crash recovery.

Subscriptions

Registering a handler subscribes; calling the returned function unsubscribes. You never manage subscriptions by hand.
Every .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.