Skip to main content

Overview

The App model represents third-party applications (TPAs) in the MentraOS ecosystem. It stores app metadata, authentication credentials, webhook configurations, and app store status.

Location

packages/cloud/src/models/app.model.ts

Schema Structure

Core Fields

App Types

App Store Status

Settings Configuration

Apps can define user-configurable settings:

Permission Declarations

Apps must declare required permissions:
Permission types include:
  • TRANSCRIPTION: Access to speech-to-text
  • AUDIO: Access to audio stream
  • CAMERA: Camera/photo access
  • LOCATION: Location data
  • NOTIFICATIONS: Phone notifications
  • DISPLAY: Screen output
  • STORAGE: Persistent storage

Hardware Requirements

Apps can specify hardware needs:

Webhook Configuration

Tool Schemas

For AI-powered apps:

Indexes

  • packageName: Unique index
  • organizationId: For org queries
  • appStoreStatus: For store filtering
  • type: For category queries
  • featured: For featured apps

Methods

Instance Methods

The App model primarily uses standard Mongoose methods:

Static Methods

Security

API Key Management

  • API keys are hashed using SHA-256
  • Never store or transmit plain text keys
  • Keys are generated using crypto-random

Webhook Security

  • Optional endpoint secrets for verification
  • HMAC signatures for webhook payloads
  • Timeout limits to prevent hanging

App Lifecycle

Development Flow

  1. DEVELOPMENT: App created, private to developer
  2. SUBMITTED: Submitted for review
  3. REJECTED: Failed review (with notes)
  4. PUBLISHED: Available in public store

Review Process

Best Practices

  1. Validate package names - Use reverse domain notation
  2. Version semantically - Follow semver (1.0.0)
  3. Declare all permissions - Be transparent
  4. Provide documentation - Help users understand
  5. Test webhooks - Ensure they’re responsive
  6. Handle errors gracefully - Don’t crash user sessions

Example Usage

Creating an App

Finding Apps for User