Skip to main content
MentraOS is how you write smart glasses apps. 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.

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. Choose an example app template based on your smart glasses type from our Example Apps page. For this quickstart, we’ll use the Display Example App. Go to this link and click Use this Template and Create a new repository.
  2. Clone your new repo locally:
    git clone <your-repo-url>
    
  3. Navigate to your repo directory and install dependencies:
    cd <your-repo-name>
    bun install
    
  4. 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
      
  5. Run your app:
    bun run dev
    
  6. 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!

Next Steps