Skip to content
SDK Docs
Discord Order Now

Ship your app

Package and validate

Bundle your app into one HTML file and check it before you install it.

Your assistant handles this with the packager and validator from the guide. It still helps to know what’s inside the file and what the checks look for.

What’s in the file

  • A manifest: a <script type="application/mira-manifest+json"> tag with your app’s title.
  • A phone screen (optional): ordinary HTML, CSS and JavaScript.
  • The glasses module: a <script type="application/mira-wasm"> tag holding your compiled WebAssembly as base64. Glasses-only apps include it too.
PingPong.html
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1">
<script type="application/mira-manifest+json">{"title":"Ping Pong"}</script>
</head>
<body>
<main id="mira-companion-root">
  <h1>Ping Pong</h1>
  <p id="status">Open the app on your glasses</p>
  <button id="ping">Ping</button>
</main>
<script>/* your phone code, using miraCompanion */</script>
<script type="application/mira-wasm">AGFzbQEAAAAB...</script>
</body>
</html>

The whole file must stay under 2 MB, and the module inside it up to 128 KB.

Naming

  • Use 1 to 31 printable ASCII characters.
  • Use exactly the same name in the manifest title and in companion::Companion::new.
  • Don’t reuse the name of an app that comes with MIRA.
  • Keep the name when you ship an update. MIRA matches versions by name, and the title in Create a Mira app must match the file. To rename an app, rebuild it with the new name in both places.

Build

Your assistant compiles the unchanged example first, to prove the toolchain works, then builds your app with the packager. The packager compiles the Rust source, embeds the module and validates the result in one step:

Terminal
rustup target add wasm32-unknown-unknown
python3 CompanionExample/package.py MyApp.html
python3 CompanionExample/validate.py MyApp.html

Keep the packager’s compiler flags. The module must declare exactly one 64 KiB memory page as both its minimum and its maximum, with an 8 KiB stack and without bulk memory or reference types:

Required flags
-C link-arg=--initial-memory=65536
-C link-arg=--max-memory=65536
-C link-arg=-zstack-size=8192
-C target-feature=-bulk-memory,-bulk-memory-opt,-reference-types

Validate

validate.py checks the file you’re actually going to install: memory limits, imported functions, entry points and a real WebAssembly validation. It needs only Python 3 and Node.js.

  • Run it on the final file, including after any manual edits.
  • Never install a file that fails. Fix every error and run it again.
  • A passing check means the package is well formed. It doesn’t prove the app behaves, so test it on your glasses. See Test on your glasses.

When you add an app, Check code in the MIRA app runs its own package check on the phone before the app is saved.