DocsBuild

Add environment variables

The keys and settings your build needs — an API base URL, an analytics id, a public key. Set per project, injected while the build runs.

Where this lives: Dashboard → Project → Variables

Add a name and a value, save, and the next deploy runs with it in the environment. Existing deploys are untouched: a variable only reaches a site by being present while that site was built.

They are build-time, not run-time

ChimeLab serves static files, so there is no server left running to read a variable when a visitor arrives. Whatever your build does with a variable — writes it into the JavaScript bundle, or reads it and throws it away — is what happens. Changing a value therefore takes a new deploy to have any effect.

Adding a variable

  1. 01

    Open Variables on the project page

    It sits under the build settings.

  2. 02

    Enter the name exactly as your code reads it

    Most frameworks only expose variables with a particular prefix to the browser — VITE_ for Vite, NEXT_PUBLIC_ for Next.js, PUBLIC_ for Astro. Without the prefix your code will read undefined.

  3. 03

    Paste the value and save

    Saved values are write-only from then on.

  4. 04

    Deploy again

    The variable reaches your site on the next build, not before.

Changing or removing one

A saved value can be replaced but never read back, so if you have lost a key you will need to get it from wherever it came from. Removing a variable and deploying again produces a build where it is simply absent.

Stuck on one of these?

Send us the repository and the last few lines of the log. We will get it live with you rather than send you a help article.