Glassly Miniapp SDK betaThe SDK is in beta, so its APIs may change before general availability.Developing on Mentra Live? We recommend using the
Glassly Bluetooth SDK.The developer tools are available in the Glassly App under Settings →
Miniapp Developer Settings.Share feedback with an in-app bug report, on
Discord, or by email at
[email protected].
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 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.
Unknown runtime
transferMethod values are rejected instead of being treated as "auto".
A handful of finer-grained exposure knobs (iso, aeExposureDivisor, isoCap,
noiseReduction, edgeEnhancement, zsl, mfnr, ispDigitalGain,
ispAnalogGain) are also accepted for cameras with manual exposure support.
They only apply once exposureTimeNs puts the camera in manual mode; most
miniapps can leave them unset.
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.
It resolves with a
CameraFovResult:
Warming up the camera
warmUp pre-warms the glasses camera so the next takePhoto is near-instant.
Warm with the same size you plan to capture with; a mismatched size forces
the camera to reconfigure and loses the speedup.
The camera stays warm for
durationMs, and the host releases the warm-up lease
automatically when the miniapp closes. Warm-ups are serialized: only one runs
at a time, and none may start while a photo is being captured. If the camera
is busy, warmUp rejects with camera_busy; retry shortly, or just call
takePhoto directly since it works regardless, only slower.
Errors
Every method returns a promise that rejects with{ code, message } on failure.
Wrap calls in try/catch and read code.

