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 records video on glasses that have a camera, like Mentra Live. startVideoRecording returns a recordingId; pass it to stopVideoRecording to end the clip.
src/background/index.ts
Camera needs the CAMERA permission and glasses with a camera. Declare a CAMERA permission and a CAMERA hardware requirement in your manifest, and check session.capabilities.hasCamera before calling.

Record

startVideoRecording resolves once the glasses report that recording started. Resolution and frame rate are optional. Omit them to use the device’s saved button-video settings. A lower fps (for example 5) keeps the glasses cooler and the file smaller on long recordings. It resolves with a VideoRecordingStarted:

Upload the recording

stopVideoRecording(recordingId) resolves to void. By default the clip stays on the glasses. To send it somewhere, pass an uploadUrl and the glasses upload the finished recording there with a multipart POST (the file is the video part):
Unlike a photo, the recording bytes don’t come back over the bridge: with an uploadUrl they go straight from the glasses to your endpoint, otherwise they stay on the device.

Errors

Every method returns a promise that rejects with { code, message } on failure. Wrap calls in try/catch and read code.
For stills, see Photos, which also covers field of view. For live video streaming, see Streaming.