Titandocs

Environment

Every VITE_* variable, what happens when it is empty, and the dev proxy table.

Env is read in src/config/env.ts. Values per mode live in .env.development, .env.staging, .env.production.

Variables

VarPurpose
VITE_API_BASE_URLBFF origin. Empty = same-origin (the /v1 dev proxy, the reverse proxy in prod). Set only when the BFF is on another host; lib/ws.ts derives the WS origin from it.
VITE_WALLETCONNECT_PROJECT_IDReown project id (public — ships in the bundle). Used by both the EVM connector and the Canton WalletConnectAdapter.
VITE_AUTH0_DOMAIN / VITE_AUTH0_CLIENT_IDAuth0 tenant for Mail sign-in. Both empty = Mail tab renders Unavailable and no Auth0Provider mounts.
VITE_PUBLIC_POSTHOG_PROJECT_TOKENPostHog project token (public)
VITE_PUBLIC_POSTHOG_HOSTPostHog ingest host (reverse-proxied)
VITE_WALLET_GATEWAY_URLCanton wallet gateway (:5003 in dev)
VITE_LEDGER_API_URLCanton ledger API (:7575 in dev)
VITE_NETWORK_IDdevnet (staging) / mainnet (production)
VITE_LOOP_NETWORKNetwork the 5N Loop session opens on, independent of VITE_NETWORK_ID.
VITE_SIGN_MESSAGE_ENCODINGbase64 (default) or raw — how the CIP-0103 wallet expects the signMessage payload.

VITE_LOOP_NETWORK defaults to mainnet on purpose — Loop accounts live there, so a devnet build must still connect Loop to mainnet or the wallet has no account to offer. The consequence: the party id that comes back is a mainnet party, and a devnet engine will not know it.

VITE_SIGN_MESSAGE_ENCODING exists because wallets disagree. Most extensions atob() a base64 payload; the Splice reference signer signs the literal text (raw). Getting it wrong produces a valid-looking signature over the wrong bytes — the engine rejects with no useful message.

Dev proxy

vite.config.ts proxies so the front end runs against a local stack with no CORS friction:

PathTargetNote
/v1:4000BFF REST and WebSocket (ws: true)
/healthz, /readyz:4000BFF health
/api/json-rpc:5003Canton wallet gateway
/v2:7575Canton ledger API

Build modes

npm run build              # mode resolved from the branch
npm run build:staging      # explicit devnet
npm run build:production   # explicit mainnet
BRANCH=main npm run build  # simulate a production branch locally
BranchModeNetwork
next, mainproductionmainnet
develop, PR previews, everything elsestagingdevnet

The mode is derived from CF_PAGES_BRANCH, not from a local .env. A local npm run build without BRANCH set produces a staging bundle — which is the right default, but surprising if you were expecting to reproduce a production artifact.

On this page