Environment variables
The app and runtime integration respect the following environment variables. Set them in your system environment or in a project .env file (if supported).
Desktop app (AI / runtime)
Section titled “Desktop app (AI / runtime)”| Variable | Description | Default |
|---|---|---|
VITE_DEPLOYED_WEB_API_BASE | When local-web flags are off, base URL for the deployed apps/web API. Dev default (unset): https://staging.web.ssscript.app. Production build default (unset): https://web.ssscript.app. Override anytime (Vite inlines at compile time). | — |
VITE_CLERK_PUBLISHABLE_KEY | Clerk publishable key (inlined at build). Set in apps/app/.env or CI to override. If unset, @repo/config uses packages/config/src/desktop-clerk.json: dev (vite / tauri dev) → test key, production build → live key (aligned with apps/web). | — |
VITE_USE_LOCAL_WEB_API | Same intent as VITE_AI_GATEWAY_DEV_MODE: route AI to local apps/web (true) or to deployedBaseUrl (false — production or VITE_DEPLOYED_WEB_API_BASE). Prefer this name in .env. | false |
VITE_AI_GATEWAY_DEV_MODE | Alias for the AI base URL switch (or with USE_LOCAL_WEB_API). | false |
VITE_LOCAL_WEB_API_BASE | Optional override for local web origin (default http://127.0.0.1:3001). | — |
VITE_AGENT_RUNTIME_BASE_URL | Optional override for the Bun agent runtime (default http://127.0.0.1:4096). | — |
VITE_LOCAL_DOCS_BASE | Optional local docs origin when using local web stack (default http://127.0.0.1:4321). | — |
VITE_ACCOUNT_DEV_MODE | Route entitlements/checkout requests to local web API (true) or deployed API (false). | false |
VITE_CLOUDFLARE_DEV_MODE | Route publish proxy requests to local web API (true) or deployed API (false). | false |
VITE_CLERK_AI_TOKEN_TEMPLATE | Optional Clerk JWT template for AI token retrieval. | — |
Web (apps/web): Anything safe to expose to the browser (if you add client-side Clerk or similar) belongs in .env / Vercel using your bundler’s public naming (often VITE_* for Vite). CLERK_SECRET_KEY and other secrets stay server-only — see apps/web/.env.example.
Web API (server-only)
Section titled “Web API (server-only)”| Variable | Description | Default |
|---|---|---|
AI_GATEWAY_API_KEY | Vercel AI Gateway API key used by /api/ai proxy routes. | — |
AI_GATEWAY_BASE_URL | Optional override for AI Gateway base URL. | https://ai-gateway.vercel.sh/v1 |
The desktop app keeps runtime local, and sends model traffic through the web /api/ai proxy so provider keys stay server-side.
- Staging web (A1): The backend can be deployed at
https://staging.web.ssscript.appwithPUBLIC_APP_OR_DOCS_URLset to that origin (separate Turso + Polar sandbox recommended). Turso: useTURSO_URL/TURSO_TOKENwith staging DB values on Preview/Development and production DB values on Vercel Production (same names, scoped per environment). - For lightweight tasks, runtime may use a smaller model for
@planwhile@builduses the main edit model. In the UI, you choose these with the@@mode picker (for example,@@plan/@@build). - For local desktop development, set
VITE_USE_LOCAL_WEB_API=true(orVITE_AI_GATEWAY_DEV_MODE=true) so AI calls usehttp://127.0.0.1:3001/api/ai. With local flags off, dev already targets staging by default; packaged production builds targethttps://web.ssscript.app. Staging signed builds:pnpm tauri:build:signed:staging(repo root) or pass--stagingto the signed build script. - Project
agent.jsonis hydrated with a multi-modelssscriptprovider catalog (OpenAI, Anthropic, xAI, Google, Moonshot) and Webflow MCP settings when project setup runs. - Runtime details (structured
@plantags,auth.set, parallel slots, diff preview): Agent runtime integration. - AI usage metering prefers gateway-reported
cost; if unavailable, spend falls back to per-model pricing estimates. - User-initiated bug reports from the AI panel and crash recovery flows are sent to the web API (
POST /api/bug-report); see Bug reports & AI diagnostics.