Environment Variables
If your site talks to external services — a form endpoint, an analytics key,
a CMS token — put those values in the Environment sheet instead of
hardcoding them. Open it with Environment in the left rail: it shows the
project’s .env file as a table, under your project’s name.
Managing variables
Section titled “Managing variables”Each row is one variable:
- Key — the name, like
RESEND_API_KEY. - Value — hidden as
••••••••until you click the eye next to it (click it again to hide it). Closing the sheet hides every value again. - Scope — Public or Build-time, explained below.
- Sync — only when the project is synced with the cloud.
To add a variable, type a key and a value in the row at the bottom and press Add (or Enter). Every row has a ⋯ menu:
| Menu item | What it does |
|---|---|
| Edit | Turns the row into fields you can type in. Press Enter or the check mark when you are done. |
| Reveal / Hide | Shows or hides the value. |
| Copy key | Copies the variable’s name — never its value. |
| Remove | Takes the variable out of the list. |
Nothing is written to .env until you press Save. While you have edits
waiting, the footer says Unsaved changes. Use the search box — or
⌘F while the sheet is open — to find a variable by name, and
All, Public and Build-time to narrow the list.
Two rules worth knowing:
- Keys starting with
PUBLIC_are visible to code running in the browser. Everything else is only available at build time — safe for secrets your pages read while building. - After saving, press Restart server in the sheet so the preview picks up the change. The button is available once you have saved.
Sync with the cloud
Section titled “Sync with the cloud”When the project is linked to your account, its variables are shared with the cloud, so cloud agents, previews and builds use the same values. The Sync column then shows, for each variable:
- Synced — the cloud has the same value.
- Differs — the cloud has a different value.
- Local only — the cloud doesn’t have it.
- Failed — the last attempt to send it to the cloud failed. The sheet says Saved locally; cloud sync failed and offers retry.
When a variable is changed somewhere else — on the web, by a cloud agent, by a
teammate — a bar appears above the table: N changes from cloud. Apply
writes the cloud’s values into your .env (save your own edits first).
Keep local sends your values to the cloud for the variables that differ.
Only workspace owners and admins can send variables to the cloud; for everyone
else, changes stay on this Mac.
What happens on publish
Section titled “What happens on publish”Publishing builds your site with the current values — they’re baked into the published output. Changed a value? Just republish.