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.
session.camera.takePhoto captures a still on glasses that have a camera, like Mentra Live. It resolves after the photo is captured and uploaded, and hands you back a download URL.
src/background/index.ts
Camera needs the CAMERA permission and glasses with a camera. Declare a CAMERA permission in your manifest so the call is allowed, and a CAMERA hardware requirement so the miniapp only installs on glasses that can capture. Check session.capabilities.hasCamera before calling so you don’t fire a request the glasses can’t satisfy.

Take a photo

takePhoto sends the request, waits while the glasses capture and the phone uploads, then resolves with the photo metadata. The returned photoUrl is a signed download URL with a short TTL (about 30 minutes), so fetch or display it soon after.
All options are optional. The defaults are listed below. Unknown runtime transferMethod values are rejected instead of being treated as "auto". The result is a PhotoTaken:

Field of view

setFov applies a temporary FOV/ROI override owned by the calling miniapp and resolves after the ASG client reports it was applied. It applies to all captures (photos and video) while that miniapp is active. When the miniapp closes, the host restores the previous live miniapp override or the persistent base setting. The factory/missing base is the centered standard preset (102 degrees); existing saved user values are preserved.
The argument is one of two shapes: It resolves with a CameraFovResult:

Errors

Every method returns a promise that rejects with { code, message } on failure. Wrap calls in try/catch and read code.
For video, see Videos. For live video streaming, see Streaming.