Skip to content

Mentra-Community/MentraOS-Camera-Example-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MentraOS-Camera-Example-App

This is a simple example app which demonstrates how to use the MentraOS Camera API to take photos and display them in a webview.

You could also send the photo to an AI api, store it in a database or cloud storage, send it to Roboflow, or do other processing.

Install MentraOS on your phone

MentraOS install links: mentra.glass/install

(Easiest way to get started) Set up ngrok

  1. brew install ngrok

  2. Make an ngrok account

  3. Use ngrok to make a static address/URL

Register your App with MentraOS

  1. Navigate to console.mentra.glass

  2. Click "Sign In", and log in with the same account you're using for MentraOS

  3. Click "Create App"

  4. Set a unique package name like com.yourName.yourAppName

  5. For "Public URL", enter your Ngrok's static URL

  6. In the edit app screen, add the microphone permission

Get your App running!

  1. Install bun

  2. Clone this repo locally: git clone https://github.com/Mentra-Community/MentraOS-Camera-Example-App

  3. cd into your repo, then type bun install

  4. Set up your environment variables:

    • Create a .env file in the root directory by copying the example: cp .env.example .env
    • Edit the .env file with your app details:
      PORT=3000
      PACKAGE_NAME=com.yourName.yourAppName
      MENTRAOS_API_KEY=your_api_key_from_console
      
    • Make sure the PACKAGE_NAME matches what you registered in the MentraOS Console
    • Get your API_KEY from the MentraOS Developer Console
  5. Run your app with bun run dev

  6. To expose your app to the internet (and thus MentraOS) with ngrok, run: ngrok http --url=<YOUR_NGROK_URL_HERE> 3000

    • 3000 is the port. It must match what is in the app config. For example, if you entered port: 8080, use 8080 for ngrok instead.

Next Steps

Check out the full documentation at docs.mentra.glass

About

A camera smart glasses app example, built with MentraOS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •