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.heading reports the phone’s compass heading. Subscribe with onUpdate() to get a HeadingData every time the heading changes.
src/background/index.ts
Heading needs the LOCATION permission in your manifest, the same key session.location uses.

Continuous updates

onUpdate() delivers a HeadingData on each heading change. It returns an unsubscribe function.

HeadingData

Permission

session.heading.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, onUpdate() produces no reading. See Permissions.
session.heading works on both Android and iOS. It shares the LOCATION manifest key with session.location.