The dashboard is a persistent overlay that appears when the user glances up. It is separate from your app’s main display. Use it for status lines, counters, or any short text the user wants to see at a glance.
The DashboardManager has two methods: showText and clear.
Quick Example
import { MiniAppServer, type MentraSession } from "@mentra/sdk";
const app = new MiniAppServer({
packageName: "com.example.dashboard-demo",
apiKey: process.env.API_KEY!,
port: 3000,
});
app.onSession((session: MentraSession) => {
session.dashboard.showText("Hello from the dashboard");
});
await app.start();
API
session.dashboard.showText(text)
Show text on the dashboard overlay. The text argument can be a string or a string[]. When you pass an array, the strings are joined with newlines.
// Single line
session.dashboard.showText("Status: connected");
// Multiple lines
session.dashboard.showText([
"Messages: 4",
"Battery: 82%",
]);
Calling showText again replaces whatever was previously displayed. Dashboard updates are automatically throttled by MentraOS Cloud (one update per 300ms) to prevent display desync, so you can call this as often as you like.
session.dashboard.clear()
Remove this app’s content from the dashboard overlay.
session.dashboard.clear();
Common Patterns
Status Line
Show a simple status message when the session starts, then clear it when you are done.
app.onSession((session: MentraSession) => {
session.dashboard.showText("Listening...");
session.onStop(() => {
session.dashboard.clear();
});
});
Updating Periodically
Display a counter that updates every second, then stop after 60 seconds.
app.onSession((session: MentraSession) => {
let seconds = 0;
const interval = setInterval(() => {
seconds++;
session.dashboard.showText(`Elapsed: ${seconds}s`);
if (seconds >= 60) {
clearInterval(interval);
session.dashboard.clear();
}
}, 1000);
});
Notification Counter
Track incoming notifications and show a running count on the dashboard.
app.onSession((session: MentraSession) => {
let notificationCount = 0;
session.phone.notifications.on((data) => {
notificationCount++;
session.dashboard.showText(`Notifications: ${notificationCount}`);
});
});
Clearing on Stop
If your app has a cleanup step, clear the dashboard so stale text does not linger.
app.onSession((session: MentraSession) => {
session.dashboard.showText("Recording in progress");
session.onStop(() => {
session.dashboard.clear();
});
});
Dashboard updates are throttled to one per 300ms by MentraOS Cloud. You do not need to debounce on your side.