Environment variables
Use environment variables for configuration and secrets: database URLs, API keys, feature flags.
Set variables
Section titled “Set variables”- When creating an app: in Advanced Settings → Environment Variables, one
KEY=valueper line. Lines starting with#are ignored, andexportprefixes and surrounding quotes are handled. - Later: open the app, go to Builds & Settings → Environment Variables, click Add Variable, then Save Environment.
- From the CLI:
hivepod deploy --env DATABASE_URL=postgresql://...(repeat--envfor each). - From the MCP server: the
set_envtool.
DATABASE_URL=postgresql://usr_1a2b3c4d:[email protected]:10042/app?sslmode=requireSESSION_SECRET=change-meNODE_ENV=production- Names start with a letter or
_and contain only letters, digits and_(up to 128 characters). - Values are a single line.
- Up to 200 variables and 64 KB in total per app.
PORTis set for you.
Secrets stay secret
Section titled “Secrets stay secret”Every value is encrypted at rest and hidden in the console: existing values appear as •••••••• (unchanged). Only the app’s owner can read them back, through an explicit reveal request to the API. Values that appear in build or health-check output are replaced with ***.
Available at build time and at runtime
Section titled “Available at build time and at runtime”Your variables are available while your app is built and when it runs. That means values that frameworks inline into the client bundle during the build work as you’d expect:
| Framework | Build-time (public) prefix |
|---|---|
| Next.js | NEXT_PUBLIC_* |
| Vite (React, Vue, Svelte, Solid) | VITE_* |
| SvelteKit, Astro | PUBLIC_* (and $env/static/* in SvelteKit) |
| Nuxt | NUXT_PUBLIC_* |
| Create React App | REACT_APP_* |
Angular (@ngx-env) |
NG_APP_* |
| Gatsby | GATSBY_* |
Server-side code (API routes, server components, Django or Rails settings read during collectstatic or assets:precompile) can read every variable during the build, too.
Secrets you set are passed to the build without being stored in your app’s image or its build history, and they’re masked as *** in the build log.
Your own Dockerfile
Section titled “Your own Dockerfile”If you deploy with your own Dockerfile, you have two options:
-
ARGfor public values. Every variable your Dockerfile declares withARGis passed to the build with your app’s value:ARG NEXT_PUBLIC_API_URLRUN npm run buildDocker records
ARGvalues in the image history, so useARGonly for values that are public anyway. -
The build secret, for everything else. All of your variables are available as a build secret named
dockhive_env, a file ofNAME='value'lines. Mount it on the step that needs it:RUN --mount=type=secret,id=dockhive_env,mode=0444 \sh -c 'set -a; . /run/secrets/dockhive_env; set +a; npm run build'The file exists only while that step runs and never ends up in your image.
When changes take effect
Section titled “When changes take effect”Saving variables doesn’t restart your app. They apply on the next deploy, which rebuilds your app with the new values: click Redeploy (or push a commit with push to deploy on). The console shows when a redeploy is needed.
A rollback starts an earlier build with your current variables. Runtime values update, but values that were inlined into the bundle at build time (for example NEXT_PUBLIC_* or VITE_*) stay as they were when that build was made. Redeploy to rebuild with the new values.