Mirra
Function Client (self-host)

Getting the client to your team

Nobody on your team has to build anything. There are two ways to reach your server. Start with the first, and add the second when you want it.

What your team opensWhat it costs you
1. Browser (start here)https://<FUNCTION_DOMAIN>, served by the compose edge containernothing beyond running the server
2. Your own CDNthe same web client, hosted on Amplify, Cloudflare Pages or another static hosta CDN account, six settings (below)

1. Browser

The quickstart ends here: the edge serves the web client and the API on one address, so there is nothing else to configure.

The browser notifies people only while a tab with the client is open.

2. Your own CDN

The web client is a static build of apps/web. Host it on a CDN when you want it on its own domain or closer to your team. The server keeps serving its own copy too.

Six steps, whichever host you use:

  1. An account with the host (AWS for Amplify, Cloudflare for Pages).

  2. Connect the host to your GitHub fork of this repository.

  3. Set one build variable, VITE_API_URL, to your server's origin (https://client.example.com). Leave VITE_STRIPE_PUBLISHABLE_KEY and VITE_SERVER_SAME_ORIGIN unset: the client takes the rest from the server's /api/client-config. Only set VITE_STRIPE_PUBLISHABLE_KEY to empty if you want a build that never loads Stripe.

  4. Send every path that isn't a file to /index.html (the client routes in the browser).

  5. Give the site your domain.

  6. On the server, set CORS_ORIGINS to both origins, comma-separated, and run up -d:

    CORS_ORIGINS=https://client.example.com,https://app.example.com

    Once it is set, it replaces the default (the server's own origin), so leaving the server's origin out breaks the web client the edge serves. If you sign in with Privy, add the site's origin to your Privy app's allowed origins too (Sign in with Privy).

Amplify

The repository's root amplify.yml is the build spec. Use the Deploy to Amplify button in the README, or connect the repository in the Amplify console:

  • Mark it a monorepo, with app root apps/web.
  • Add VITE_API_URL under environment variables.
  • Add the rewrite that step 4 needs. amplify.yml's header has the exact source pattern: target /index.html, type 200 (Rewrite).

Cloudflare Pages

Create a Pages project from your fork (the README's Deploy to Cloudflare Pages button opens that screen) with:

SettingValue
Root directoryapps/web
Build commandnpm run build:web
Build output directorydist
Environment variablesVITE_API_URL=<your server's origin>, NODE_VERSION=22, PUPPETEER_SKIP_DOWNLOAD=true

Pages serves index.html for unknown paths by itself, because the build has no 404.html, so step 4 needs nothing here.

On this page