Build environment variables for frontends
Frontends now have a build environment: variables the platform sets while
it builds your frontend from source, such as a GitHub push or a template deploy.
Use it for values like VITE_POCKETBASE_URL that your framework reads at build
time.
Add variables under Build Environment on the frontend’s page in the portal, or from the CLI:
pbc env set VITE_POCKETBASE_URL=https://my-db.example.com --target frontend --name my-site
pbc env import .env.production --target frontend --name my-site
Any variable name works except a few the build platform sets itself, such as
HOME and PATH. Values are stored unencrypted and visible to anyone with
access to the frontend, and variables your framework exposes to the browser
(such as VITE_ or NEXT_PUBLIC_) end up in the public bundle. The install
step sees them too, so a private-registry token like NPM_TOKEN works. They
are limited to 10 KB in total, and values of 8 or more characters are masked
in build logs. pbc frontend deploy and ZIP uploads build on your own
machine, so they keep using your shell’s environment.
Browser error collection moved to the frontend’s Settings page.
See Deploying a Frontend.