MentraOS is how you write cloud Mini Apps for smart glasses. In this Quickstart, we go from zero to fully functioning app in less than 15 minutes. You just need a phone and some basic TypeScript knowledge to get started, you can get started without smart glasses, or use one of these smart glasses.
Building a mobile app that connects directly to glasses over Bluetooth? Use the Bluetooth SDK Quickstart.

Step 1: Install the Mentra app on your phone

Install MentraOS on your Android or iPhone from MentraGlass.com/OS.

Step 2: Set up ngrok

We are going to use ngrok to expose your local app to the internet. This is useful for development, but when you’re ready to go live, you’ll want to deploy to a cloud service.
  1. Install ngrok
  2. Create an ngrok account
  3. Set up a static address/URL in the ngrok dashboard
Make sure you run the ngrok config add-authtoken <your_authtoken> line. Make sure you select Static Domain, then generate a static domain.

Step 3: Register your app with the Mentra Relay Server

This example app will send traffic through the Mentra Relay Server, which connects your phone to your app through the internet. Later, you can run your own Relay Server.
  1. Log in to console.mentraglass.com with the same account you’re using for MentraOS.
  2. Click “Create App”. Set a unique package name like com.yourName.yourAppName. For “Public URL”, enter your ngrok static URL.
  3. Add microphone permission.
This automatically installs the app for your user - check the Mentra app on your phone. For other people to test the app, they need to install it. You can retrieve your app’s install link from “My Apps” page, click the Share icon.

Step 4: Start your app

Ensure you have Node.js v18 or later and Bun installed.
  1. Pick the example app template that matches your smart glasses:
    Compatible glasses: Mentra LiveUse the Camera Example App - it captures photos using the glasses’ camera and shows them on the user’s phone.Repository: MentraOS-Camera-Example-AppGo to the link above and click Use this Template then Create a new repository.
    You must be signed into GitHub to see the “Use this template” button.
    Clone your new repo locally using the URL from your newly created repository.
  2. Navigate to your repo directory and install dependencies:
    cd <your-repo-name>
    bun install
    
  3. Set up your environment variables:
    • Create a .env file in the root directory by copying the example, then edit the .env file with your own app’s details.
      cp .env.example .env
      
  4. Run your app:
    bun run dev
    
  5. Expose your app to the internet with ngrok:
    ngrok http --url=<YOUR_NGROK_URL_HERE> 3000
    
    Note: 3000 is the port. It must match what is in the app config.

Step 5: App Running!

Go to your phone and open Mentra. Start your app. Begin speaking, and you’ll see what you say overlaid on your smart glasses display. You’ll also see logs in the console. Congratulations, you just built your first smart glasses app!

Understanding the Code

Once your app is running, here’s what’s happening under the hood. A MentraOS app has three parts: a server that receives connections, a session for each user, and managers that interact with the glasses.
import { MiniAppServer, type MentraSession } from "@mentra/sdk";

const app = new MiniAppServer({
  packageName: "com.example.myapp",
  apiKey: process.env.API_KEY!,
  port: 3000,
});

app.onSession((session: MentraSession) => {
  // This runs once per user when they start your app.
  // `session` is your connection to that user's glasses.

  // Listen to what the user says
  session.transcription.on((data) => {
    // Show their words on the glasses display
    session.display.showTextWall(data.text);
  });
});

await app.start();
MiniAppServer handles the server - webhooks, WebSocket connections, routing. You create one instance and register callbacks. MentraSession is your connection to one user. Everything you do with that user goes through the session object. Each capability is a manager you can access directly:
ManagerWhat it does
session.transcriptionReal-time speech-to-text from the microphone
session.translationReal-time translation
session.displayShow text, cards, and images on the glasses
session.speakerPlay audio and text-to-speech
session.micRaw audio chunks and voice activity detection
session.cameraTake photos and stream video
session.deviceHardware state, battery, connection, model info
session.phoneNotifications, calendar events, phone battery
session.storagePersistent key-value storage for your app
session.locationGPS location
session.permissionsCheck what your app is allowed to do
session.ledControl the LED light on supported glasses
session.dashboardWrite to the system dashboard view
session.timeTimezone-aware time utilities
Explore these managers - each one is fully typed, so your editor’s autocomplete will show you what’s available.

Next Steps