Get started
1. Register your website
- Install your miniapp once in the Mentra App from its URL, so Mentra knows it.
- Sign in to the Mentra Developer Console and open Websites.
- Enter your miniapp’s package name and your site’s redirect URI, then Register website.
A website signs people in for a miniapp only from the domain the miniapp’s name
belongs to.
com.example.notes belongs to example.com, so its website’s
redirect URIs must be on example.com or one of its subdomains. It is the same
rule that decides where a miniapp can be served from.2. Send people to Mentra and take them back
Use the authorization code flow with PKCE. Withopenid-client on your server:
3. Use the token on your backend
tokens.access_token is the person’s miniapp token for your package. Verify it
with @mentra/auth, exactly as
for a request from the phone:
localStorage.
Tokens
Refresh with
oidc.refreshTokenGrant(config, refreshToken). A refresh is also
when Mentra tells you things have changed: if the person revoked your site, or
your miniapp was archived, it answers with an error and you should sign them
out. A 503 means “try again”, not “no”.
What your backend can tell
Site types
Develop on your own computer
Register a second website with Environment: Development and a redirect URI on your machine, such ashttp://127.0.0.1:5173/callback. A development website
signs in only you.
Signing out, and being signed out
- To sign someone out of your site, end your own session and revoke the refresh
token with
oidc.tokenRevocation(config, refreshToken). - People see the sites they have allowed, and can revoke any of them, under Connected apps on account.mentraglass.com. Your next refresh then fails.

