session.telemetry lets your miniapp report its own events, such as a call
starting or a task finishing, with a few flat properties. Your organization sees
them in Fleet Management in Mentra Portal, with no dashboard to build: you only
capture events.
src/background/index.ts
Capture an event
capture(event, properties?) takes an event name and, optionally, an object of
properties. It sends a one-shot message to the Mentra App and returns nothing:
it never throws and never waits for the Mentra App, so you can call it anywhere
without await or try.
- Capture from your miniapp’s background code, through
session. Only the phone-side Mentra Miniapp SDK captures events; your miniapp’s own backend can’t send them. - No permission or manifest entry is needed.
- The Mentra App attributes each event to the miniapp that sent it, with its installed version.
- Delivery is best effort. Events captured while the phone is offline wait on the phone and go later, but the phone keeps only a limited number of them, for up to seven days: when that space runs out the oldest give way, and events that wait too long expire. Events are only delivered when the organization’s Fleet Management is on. What the phone loses is counted, and Fleet Management shows those counts beside your events.
Older Mentra Apps
On a Mentra App that doesn’t support telemetry,capture does nothing. Call it
the same way everywhere; you don’t need to check first.
If you do need to know, for example to hide a setting that only makes sense with
telemetry, read session.hostFeatures?.telemetry. It is true when the Mentra
App supports it. This is optional, and it says the app takes events, not that
each one will be delivered.
Limits
The Mentra App checks each event before it queues it. What breaks a limit is dropped or cut, never sent as is, and your miniapp isn’t told.
What Fleet Management shows is capped too:
- your miniapp’s first 100 event names;
- for each event, its 50 most frequent properties;
- for each property, its 50 most frequent values, with the rest shown as “Other”.
"failed" rather than an error message.
No personal data
Telemetry must not contain personal data:- no names, emails or phone numbers;
- no free text a person typed;
- no content: nothing of what was said, seen or written.
The Mentra App’s own analytics setting doesn’t apply to these events. They go to
the organization’s Fleet Management, not to Mentra’s product analytics.
Where events show up
Events appear in the workspace’s Fleet Management in Mentra Portal, on your miniapp’s page under Usage → Events, for the workspace’s admins and owners. A private miniapp from another organization appears there only as a numbered “Private miniapp”, with no events. Fleet Management works out how to show each property from its values:- an event shows its count over time;
- a number shows its average, with approximate percentiles;
- a string or a boolean shows a breakdown by value.
call_started shows as “Call started”, and a _s
suffix is read as seconds, so duration_s shows as a duration.
Example: a calling miniapp
A miniapp that joins video calls reports onecall_started and one
call_ended per call:
src/background/index.ts
call_started with no call_ended can mean a call the phone
lost, for example to a crash, but also an event that was dropped on the way:
read it alongside the loss counts.
