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.To enable miniapp development, open Settings in the Mentra App and tap the version number at the bottom ten times. Then open Debug Settings, turn on Miniapp Developer Settings, return to Settings, and open Miniapp Developer Settings.Share feedback with an in-app bug report, on Discord, or by email at help@mentra.glass.
session.location reports the phone’s GPS position. Get a single fix with getOnce(), or subscribe to a stream with onUpdate().
src/background/index.ts
Location needs the LOCATION permission in your manifest. Without it, the phone rejects both paths with PERMISSION_NOT_DECLARED and no reading arrives.

A single fix

getOnce() resolves with the next available reading from the phone. Use it at app load to seed your UI before a stream starts.
It returns a Promise<LocationData>.

Continuous updates

onUpdate() delivers a LocationData every time the position changes. It returns an unsubscribe function.

LocationData

Both paths hand you the same shape:

Permission

session.location.hasPermission is true when LOCATION is declared in your manifest. It reports the manifest declaration, not the OS grant: if the user denied the system location prompt, getOnce() and onUpdate() produce no reading. See Permissions.
LOCATION and BACKGROUND_LOCATION are separate manifest keys, and hasPermission checks for LOCATION only. For turn-by-turn directions built on position, see session.navigation.