Skip to main content
Mentra Miniapp SDK betaThe SDK is in beta, so its APIs may change before general availability.To put a miniapp in front of users, host it at an HTTPS URL and share the link, or get it listed in the Mentra Miniapp Store. See Publish your miniapp.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.stream starts and stops a live video stream from camera glasses like Mentra Live. One method, startStream, covers both ways to stream: Mentra hosts it for you (the default), or you publish straight to a URL you own.
src/background/index.ts

Managed streaming (default)

Call startStream() with no direct URL and Mentra provisions a hosted stream, handles transport and reconnection, and returns playback URLs. This is the right choice for most apps.
src/background/index.ts

WHIP goes through the phone

With ingest: "whip", the glasses don’t publish over their own Wi-Fi. They start a hotspot, the phone joins it, and the phone relays the stream to Mentra over its cellular connection. So:
  • The phone needs working cellular data (or Ethernet) while it streams.
  • Keep the phone near the glasses, and keep the Mentra App running.
  • If the phone leaves the glasses’ hotspot, for example to join a known Wi-Fi network, the relay drops. It reconnects by itself and reports reconnecting, then reconnected; see Stream status. While it does, the glasses’ Wi-Fi status can read as disconnected; that is the hotspot being rebuilt, not the cause of the drop.
For long sessions that don’t need sub-second latency, "srt" or "rtmp" lets the glasses publish from their own Wi-Fi with no phone relay.

Direct streaming

Pass direct with your own ingest URL (rtmp/rtmps/srt/whip) and the glasses publish straight to it, with no Mentra relay. You manage the endpoint, and no playback URLs come back.
src/background/index.ts
video, audio, and sound work the same as managed. destinations and ingest are ignored for direct streams.

Result

startStream resolves to a StreamResult:

Stream status

onStatus reports what happens to the stream after it starts. It returns an unsubscribe function.
src/background/index.ts
Each StreamStatus has streamId, status, and a source saying who reported it: A stream that reconnects by itself keeps its streamId and playback URLs. After an error from "coordinator", call startStream() again.

Stop

stop ends the stream. Pass the streamId from the start result, or omit it to stop the active stream.
src/background/index.ts