MentraOS Documentation

repository·dev·Indexed 24 days ago

https://github.com/mentra-community/mentraos

An open-source operating system for smart glasses providing a unified API for hardware access, pairing, and data streaming. It includes the IBluetoothManager for cross-compatible Bluetooth operations across K900 and Android devices, ComManager for K900 serial communication, and a platform-agnostic FileManager system for secure file operations. The project also features cloud-v2, a horizontally scalable backend for local JS miniapp SDKs.

Tokens
915.9K
Snippets
1.8K
Records
4.1K
Agent score
80%

What's inside MentraOS

  1. Overview of Mentra Cloud Core Services (@mentra/cloud-core)

    dev

    Mentra Cloud Core Services (@mentra/cloud-core) is the proprietary central cloud product that powers the Mentra ecosystem. It hosts the shared application and developer ecosystem, authentication, and bundle storage.

    Important Integration Note: OEMs (Original Equipment Manufacturers) do not self-host these services. Instead, they access them through the Cloud Proxy.

  2. Overview of OTA Package Components

    dev

    The OTA I/O package is organized into several functional layers:

    • Interfaces: Defines the contracts for services (IOtaService), helpers (IOtaHelper), and callbacks (OtaProgressCallback).
    • Core: Contains the central management logic (OtaManager), service factories (OtaServiceFactory), and base implementations (BaseOtaService).
    • Services: Handles Android service lifecycle, notifications, and event bus integration (OtaService).
    • Helpers: Provides robust implementation for version checking, downloading, and backup management (OtaHelper).
    • Events: Manages progress updates via OtaEventBus using DownloadProgressEvent and InstallationProgressEvent.
    • Utils: Provides utility functions for version management, file integrity (MD5), storage checks, and formatting (OtaUtils, OtaNotificationManager, OtaConstants).
  3. Overview of Mentra Miniapp SDK and Cloud V2 Packages

    dev

    The Mentra Miniapp SDK and Cloud V2 developer ecosystem are distributed via five primary npm packages. These packages provide the runtime, CLI tools, scaffolding, and authentication helpers required to build and deploy miniapps.

    PackageSourceDescription
    @mentra/miniappmobile/modules/miniappThe SDK runtime containing MiniappSession, modules, and /background, /ui, and /react support. Ships compiled JS + types.
    @mentra/miniapp-clisdk/miniapp-cliThe mentra-miniapp author CLI for dev, release, pack, and manifest commands. Bun-only
    create-mentra-miniappsdk/create-mentra-miniappThe scaffolder and template for new projects. Bun-only
    @mentra/authcloud-v2/packages/authCloud V2 auth helper for miniapp backends to verify Local Runtime JWKS tokens. Node-compatible.
    @mentra/clicloud-v2/packages/cliThe primary mentra developer CLI for building and publishing to the Cloud V2 console. Wraps @mentra/miniapp-cli and adds login/org/miniapps/releases/publish. Bun-only
  4. Overview of MentraOS

    dev

    MentraOS is an open-source operating system designed for smart glasses. It provides a unified abstraction layer that allows developers to build applications once and run them across multiple hardware platforms. MentraOS handles complex low-level tasks such as pairing, connection management, data streaming, and hardware access (displays, microphones, cameras, speakers), enabling rapid application development.

    Key features include:

    • Cross-Compatibility: One app runs on various supported smart glasses.
    • Hardware Abstraction: Access all glasses' sensors and peripherals through a single API.
    • Multi-App Execution: The Mentra Runtime allows multiple MiniApps (e.g., captions, AI notes, notifications) to run simultaneously over a single shared connection.
    • Open Source: Licensed under MIT, providing full control over hosting and modification.
  5. Overview of the Mentra Bluetooth SDK

    dev
    The Mentra Bluetooth SDK is a standalone SDK designed for communicating with smart glasses. It provides a unified API for managing Bluetooth Low Energy (BLE) communication, audio streaming (supporting LC3 and PCM codecs), display control, microphone capture, camera control (photo, video, RTMP), and device management. It is intended for enterprise customers who want to integrate smart glasses into their own mobile applications without requiring the full MentraOS or Mentra cloud infrastructure.
  6. Overview of the v3 Smoke Test mini app

    dev

    The v3-smoke-test is a minimal mini app designed to validate the MentraOS SDK v3 runtime and the Hono webview developer workflow. It is intended to exercise core v3 functionalities without the complexity of larger example applications.

    Key components and features exercised by this app include:

    • Runtime & Server: MiniAppServer and Bun fullstack /webview routes.
    • Session & Connectivity: MentraSession management, transcription subscriptions, and reconnect callbacks.
    • Authentication: @mentra/react auth initialization and createMentraAuthRoutes() for token exchange.
    • API & UI: Authenticated Hono API routes, basic display output, and Bun Hot Module Replacement (HMR) for the frontend.
  7. Overview of the MentraOS Audio Service

    dev

    The Audio Service is the stateful core of the MentraOS runtime. It manages the live transcription and translation path, converting user audio into transcripts and translations and pushing them back to the client via WebSocket.

    Because live transcription sessions must maintain continuity without gaps during failures, the service includes specialized ownership and failover machinery. It operates on top of the runtime transport contract and relies on cloud-runtime tokens for authentication, extracting the user id and tenantId from the token claims to verify the audio path.

  8. Overview of @mentra/cloud-client

    dev

    @mentra/cloud-client is a TypeScript library that serves as the phone's connection to Cloud V2. It is a headless library (no UI) responsible for opening connections, sending requests, and receiving events.

    Key characteristics:

    • Environment Agnostic: The same code runs on both the phone and a server. Platform-specific dependencies (like network sockets or secure storage) are injected via specific entry points: @mentra/cloud-client/react-native for mobile devices and @mentra/cloud-client/node for testing environments.
    • V2 Exclusive: It is built specifically for the V2 cloud architecture and does not support or include V1 legacy messages or REST calls.
    • Type Safety: It uses shared definitions from @mentra/cloud-runtime/protocol to ensure that subscriptions and events are perfectly synchronized with the cloud server's types, preventing runtime message mismatches.
  9. Overview of the ASG Server Package

    dev
    The ASG Server Package provides a modular, interface-based server architecture for AugmentOS Smart Glasses (ASG) applications. It allows local network access to camera functionality and other services. The architecture is built on SOLID principles and uses dependency injection to provide extensible services like rate limiting, file caching, and network provisioning.
  10. Overview of Console2 Developer Console

    dev
    Console2 is the developer-facing interface for MentraOS. It is designed to manage developer-specific workflows including package claims, bundle versions, CLI authorization, store submissions, logs, tokens, and signing keys. Note that Console2 does not handle internal admin review queues or enterprise/OEM trusted issuer management; those are separate administrative functions.