Skip to content
Download

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).

VariableDescriptionDefault
VITE_DEPLOYED_WEB_API_BASEWhen 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_KEYClerk 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_APISame 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_MODEAlias for the AI base URL switch (or with USE_LOCAL_WEB_API).false
VITE_LOCAL_WEB_API_BASEOptional override for local web origin (default http://127.0.0.1:3001).
VITE_AGENT_RUNTIME_BASE_URLOptional override for the Bun agent runtime (default http://127.0.0.1:4096).
VITE_LOCAL_DOCS_BASEOptional local docs origin when using local web stack (default http://127.0.0.1:4321).
VITE_ACCOUNT_DEV_MODERoute entitlements/checkout requests to local web API (true) or deployed API (false).false
VITE_CLOUDFLARE_DEV_MODERoute publish proxy requests to local web API (true) or deployed API (false).false
VITE_CLERK_AI_TOKEN_TEMPLATEOptional 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.

VariableDescriptionDefault
AI_GATEWAY_API_KEYVercel AI Gateway API key used by /api/ai proxy routes.
AI_GATEWAY_BASE_URLOptional 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.app with PUBLIC_APP_OR_DOCS_URL set to that origin (separate Turso + Polar sandbox recommended). Turso: use TURSO_URL / TURSO_TOKEN with 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 @plan while @build uses 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 (or VITE_AI_GATEWAY_DEV_MODE=true) so AI calls use http://127.0.0.1:3001/api/ai. With local flags off, dev already targets staging by default; packaged production builds target https://web.ssscript.app. Staging signed builds: pnpm tauri:build:signed:staging (repo root) or pass --staging to the signed build script.
  • Project agent.json is hydrated with a multi-model ssscript provider catalog (OpenAI, Anthropic, xAI, Google, Moonshot) and Webflow MCP settings when project setup runs.
  • Runtime details (structured @plan tags, 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.