Build-time Env Vars Playground

The workshop’s key board: which .env keys go out to the browser, and in what form? Try a secret given a VITE_ name too; this page’s own import.meta.env is…

Why it matters

One prefix decides what becomes public. A missing prefix makes a value undefined; a misplaced one sends a secret API key to anyone who opens DevTools. And since values are written at build time, changing .env afterwards does not change the site.

The key idea

import.meta.env.VITE_X is not a variable: it is replaced by text at build

Common mistakes

Try it in this playground