What Are App Settings?
App settings are user-configurable options that control how your application behaves. They are:- Persistent: Settings are stored in the cloud and synchronized across devices
- Type-safe: Each setting has a defined type (toggle, text, select, etc.)
- Real-time: Changes are immediately synchronized to your running app
- User-friendly: Displayed in the MentraOS app with proper UI controls
- Display preferences (langauges, layouts)
- Feature toggles (enable/disable functionality)
- User login or API keys
Defining Your Settings
Settings are defined in the developer console. Go to console.mentra.glass/apps and edit your app, then look for the “App Settings” section.
key
: The unique identifier for the setting, used in your app codelabel
: The human-readable name of the setting shown in the settings UIdefaultValue
: The default value for the settingtype
: The type of the setting (toggle, text, select, etc.)options
: For select settings, a list of allowed valueslabel
: The human-readable name of the option shown in the settings UIvalue
: The unique value of the option, used in your app code
min
andmax
: For slider settings, the minimum and maximum values
Setting Types
MentraOS supports several setting types:Toggle (Boolean)
On/off switches for boolean values.Text Input
Text input with a save button, that only updates when the user presses the save button.Text (No Save Button)
Multi-line text input without save button. It saves whenever the user makes a change.Select (Dropdown)
Single choice from predefined options. The default value should be a single value matching the value of one of the options.Select with Search
Dropdown with search functionality for long lists. The default value should be a single value matching the value of one of the options.Multiselect
Multiple choices from options. The default value should be an array of values (which may be empty).Slider
Numeric value selection.Group
Organize settings into logical sections. Displays the title as a group seperator. Use this to delieate the start of a new section of settings.Title/Value Display
Read-only display of information, shown in the UI as the title (label) and the value.Accessing Settings in Your App
Using the Settings Manager
The app session provides asettings
property with methods to access and monitor settings:
Listening for Setting Changes
React to setting changes in real-time:Common Patterns
Feature Toggles
Language Selection
Best Practices
1. Provide Sensible Defaults
Always specify appropriate default values that work for most users:2. Group Related Settings
Use group settings to organize related options:3. Use Descriptive Labels
Make settings self-explanatory:4. Clean Up Listeners
Remove setting change listeners when your app stops:Settings Lifecycle
- Definition: Settings are defined in the developer console
- Storage: Settings are stored in MentraOS Cloud
- Synchronization: When an app starts, settings are automatically loaded
- User Changes: Users modify settings through the MentraOS Mobile App
- Real-time Sync: Changes are immediately pushed to running apps
- Persistence: Settings persist across app restarts and devices
Related Documentation
- Setting Types Reference - Detailed type definitions for settings
- Settings Manager - API reference for the settings manager
- Getting Started with Apps - Complete guide to building an app
- Core Concepts - Understanding app architecture