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.input delivers the physical controls on the glasses: button presses and touchpad gestures. The starter scaffold wires a button press to the display, so a short press shows a text wall.
src/background/index.ts
Button events only reach glasses that have a button. Declare a BUTTON hardware requirement in your manifest to gate the miniapp to those glasses.

Button presses

onButtonPress fires on every press of a physical button:
Each ButtonPressData has:

Touch gestures

onTouch subscribes to touchpad gestures. Pass a handler for every gesture, a single gesture name to filter, or an array of names for one subscription across several gestures.
Each TouchData has: The gesture values the runtime reports: Glasses can send other kind strings, so kind is typed as string. Match the values you handle and ignore the rest.

Cleaning up

onButtonPress and every onTouch form return an unsubscribe function:
Calling onTouch with an array returns one unsubscribe function that drops all of the gestures it registered.