Environment variables
The environment variable manager stores your app's configuration per project and environment. Values are stored in CloudCode's database and protected by row-level security, so only you can read them. One-click deploys send them to Vercel.
- A deploy sends the variables of the environment you deploy to (the preview toolbar always uses Production). The deploy service reads them on the server after checking that you own the project. Values never pass through the browser and are never logged
- Deploying a single workspace from the Dashboard applies that workspace's overrides on top of the project's variables
- Each variable is available to the build (Vite exposes only VITE_-prefixed ones to the browser as import.meta.env.VITE_*) and, at runtime, to server code such as Node.js apps and Next.js server routes as process.env
- Names Vercel reserves (for example AWS_REGION, TZ or anything starting with VERCEL_) and names that aren't valid identifiers are skipped, and the deploy log lists them
- Pure static deploys have no build step, so nothing substitutes the variables into the files
- The dev preview doesn't receive them
- When you push to GitHub and the repo has no .env.example, CloudCode generates one from your Production variables (secret values replaced by placeholders), along with a .gitignore that excludes .env files
- The agent's environment check compares the variables your code references against the names defined here and reports any that are missing
In a Vite app, read browser-safe values such as an API base URL or a Supabase URL and anon key from import.meta.env.VITE_*. Keep real secrets server-side, for example as Supabase edge-function secrets, or as variables without the VITE_ prefix that only server code reads. If you deploy from GitHub through your own Vercel project, set variables in Vercel.
// src/lib/config.ts: VITE_ values are inlined at build time and shipped to every visitor
export const API_BASE_URL = import.meta.env.VITE_API_BASE_URL;
// Supabase edge function (server-side): secrets set with `supabase secrets set`
const secret = Deno.env.get("MY_SECRET_KEY");VITE_ variables in a Vite build, is publicly readable. Never put API secrets there.