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 opens | What it costs you | |
|---|---|---|
| 1. Browser (start here) | https://<FUNCTION_DOMAIN>, served by the compose edge container | nothing beyond running the server |
| 2. Your own CDN | the same web client, hosted on Amplify, Cloudflare Pages or another static host | a 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:
-
An account with the host (AWS for Amplify, Cloudflare for Pages).
-
Connect the host to your GitHub fork of this repository.
-
Set one build variable,
VITE_API_URL, to your server's origin (https://client.example.com). LeaveVITE_STRIPE_PUBLISHABLE_KEYandVITE_SERVER_SAME_ORIGINunset: the client takes the rest from the server's/api/client-config. Only setVITE_STRIPE_PUBLISHABLE_KEYto empty if you want a build that never loads Stripe. -
Send every path that isn't a file to
/index.html(the client routes in the browser). -
Give the site your domain.
-
On the server, set
CORS_ORIGINSto both origins, comma-separated, and runup -d: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_URLunder environment variables. - Add the rewrite that step 4 needs.
amplify.yml's header has the exact source pattern: target/index.html, type200 (Rewrite).
Cloudflare Pages
Create a Pages project from your fork (the README's Deploy to Cloudflare Pages button opens that screen) with:
| Setting | Value |
|---|---|
| Root directory | apps/web |
| Build command | npm run build:web |
| Build output directory | dist |
| Environment variables | VITE_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.