Vite (SvelteKit)
Configure VITE_* variables for the SvelteKit web app—API base URL, Supabase, Stripe, analytics, and the HTTPS dev proxy.
Connect your agent today
Draft from chat, review in your calendar, and publish only what you approve.
Overview
The web app is built with SvelteKit on Vite. At runtime it reads public env vars in the VITE_* family from web/.env.* (Vite loads these at dev and build time).
When you change values in web/.env.development.local or web/.env.production.local, restart the web dev server or rebuild so Vite can load the new values.
Steps
Copy the development env template
Copy web/.env.development.example to web/.env.development.local.
Set required variables
Set these in web/.env.development.local (values from your backend, Supabase, Stripe, and analytics setup):
VITE_API_BASE_URL=
VITE_FRONTEND_DOMAIN_URL=
VITE_PUBLIC_SUPABASE_URL=
VITE_PUBLIC_STRIPE_PUBLISHABLE_KEY=
VITE_PUBLIC_STRIPE_PRICE_ID_SOLO_MONTHLY=
VITE_PUBLIC_STRIPE_PRICE_ID_SOLO_YEARLY=
VITE_PUBLIC_STRIPE_PRICE_ID_TEAM_MONTHLY=
VITE_PUBLIC_STRIPE_PRICE_ID_TEAM_YEARLY=
VITE_PUBLIC_STRIPE_PRICE_ID_ULTIMATE_MONTHLY=
VITE_PUBLIC_STRIPE_PRICE_ID_ULTIMATE_YEARLY=
VITE_PUBLIC_STRIPE_PRICE_ID_MAX_MONTHLY=
VITE_PUBLIC_STRIPE_PRICE_ID_MAX_YEARLY=
VITE_PUBLIC_GOOGLE_ANALYTICS_MEASUREMENT_ID= Note
Treat www and the apex host as different origins—for example https://www.example.com and https://example.com are not interchangeable for OAuth.
In production, set VITE_FRONTEND_DOMAIN_URL to the same string as FRONTEND_DOMAIN_URL on the backend (see Configuration - Backend and Production deployment). The backend builds provider redirect URIs from FRONTEND_DOMAIN_URL only; Meta and similar dashboards must list those full URLs character-for-character.
Do not add a trailing slash after the host. If you change either variable, rebuild the web app and restart or redeploy the API so both pick up the new origin.
HTTPS local development and the API base URL
The web dev server in this repo uses HTTPS on https://localhost:5173 (local certificates under web/.cert/). Session cookies for sign-in must be issued on the same site as the page origin, so the browser should call the API as same-origin /api/… in development, not a separate http://localhost:3000 origin.
Warning
Do not point VITE_API_BASE_URL at http://localhost:3000 when the app runs on HTTPS. If VITE_API_BASE_URL is set to http://localhost:3000 while you open the app on https://localhost:5173, the scheme differs and the browser treats that as a different site: refresh cookies may not be sent and Google sign-in can loop or fail.
For local HTTPS, omit VITE_API_BASE_URL from web/.env.development.local (or set it to an empty value). The web app then uses a relative API base so requests go to https://localhost:5173/api/....
In development, web/src/hooks.server.ts forwards /api/* to the process listening on http://localhost:3000 (see web/vite.config.ts for the same target). Optional override: set DEV_BACKEND_PROXY_TARGET in web/.env.development.local if the API is not on port 3000.
Set production env values
For deployment, ensure web/.env.production.local (or your host’s production env) sets the same key names with production values. Double-check VITE_FRONTEND_DOMAIN_URL against FRONTEND_DOMAIN_URL on the API before you register OAuth redirect URIs in external dashboards.
Stripe subscription price ids are configured on the web (VITE_PUBLIC_STRIPE_PRICE_ID_SOLO_MONTHLY, and so on). See Stripe billing.