Where to Find Them
Open your project and go to Environment Variables. Project Settings also shows a read only summary (how many variables you have, how many are sensitive, when they last changed) with a Manage button that takes you to the same place. Settings never displays values.Choosing Environments
Every variable has an environment setting. There are no separate tabs to switch between; each variable row carries its own scope:STRIPE_SECRET_KEY scoped to Production with your live key, then add it again
scoped to Development and Staging with your test key. Hiveku picks the right one
based on where your app is running.
Adding a Variable
Click Add Variable
Enter a name and value
my key
becomes MY_KEY. Names must start with a letter and use only A-Z, 0-9 and
underscores.Pick the environments
Click Save changes
Redeploy if needed
NEXT_PUBLIC_*) always need a redeploy to
reach the browser bundle.Editing, Renaming and Deleting
Changes are staged and applied together when you click Save changes. A footer appears whenever you have unsaved edits, summarising what will be added, updated or removed, and dirty rows are marked so you can see exactly what you touched.- Rename: edit the name. Saving moves the value to the new name and removes the old one, so you do not end up with two copies.
- Change environments: pick a different scope. The row shows you which stored keys will change before you commit to it.
- Delete: click the bin icon. The row is struck through with an Undo link and nothing is removed until you save. You get a confirmation naming exactly what will be deleted.
- Discard changes: throws away everything unsaved and reloads.
Sensitive Variables
Marking a variable Sensitive makes it write only. After you save, the value is hidden everywhere in Hiveku and cannot be revealed again. This applies to everyone and everything:- You, and every member of your account
- Hiveku staff and support
- AI agents, the MCP tools and the Hiveku CLI
- The VS Code extension and
hiveku-sync
Tick Sensitive on the row
Save changes
Hidden. Sensitive.Leave it blank to keep it
After the first save, the value field stays blank and showsHidden. Sensitive. on
every later visit. That blank is the convention: saving with the field untouched
keeps the stored value exactly as it is. Blank never means clear for a sensitive
variable, so you can rename it, change its environments, or edit other rows and save
without re-entering anything.
Changing a sensitive value
You cannot un-hide a value, because nobody (including Hiveku) can retrieve it to show you. Click Replace value on the row, type a new value, and save. To make the variable readable again, untick Sensitive and supply a new value at the same time. A replacement cannot be empty: the panel refuses to save a sensitive variable with no value. If you change your mind mid-edit, click Cancel replacement and the stored value stays untouched. If you lose a sensitive value, generate a new one at the provider and replace it.What sensitive does not protect against
Your deployed app still receives the value inprocess.env, and you control your own
source code. Anyone who can deploy code to your project can write a route that prints
it. Sensitive variables protect against casual exposure, restricted teammates, and AI
agents reading credentials into a chat transcript. They are not a barrier against
someone who can already ship code to your project.
NEXT_PUBLIC_, which is public by
design and which you will want to read back while debugging.Importing From a .env File
Click Import and paste the contents of a.env file. The parser handles comments,
export prefixes, quoted values, and values containing = signs. Anything it cannot
read is reported by line number rather than silently skipped. Imported variables are
staged like any other edit, so review them before saving.
Sharing Variables Between Sites
When several sites use the same values (a shared API key, a mail provider’s settings), keep them in an environment group and link the group to each site. A change to the group reaches every linked site. The site’s own variables always win over a group’s: the Environment groups card on this page shows which group variables the site replaces.Working With AI
Hiveku AI
You can ask the AI chat in the editor to manage variables for you:AI tools you connect
Claude Code with the Hiveku plugin, Codex, the VS Code extension and Hiveku Sync work with the same variables through Hiveku’s tools. A tool can do only what the person whose Hiveku key it uses can do on this page. What they can read- Names, environments and whether each variable is sensitive, never values:
project_secrets_list(it requiresmetadata_only: true) andproject_secrets_get.project_env_matrixcompares environments without showing any value, including the variables a site gets from its linked environment groups. - A non-sensitive value, only through
project_secrets_reveal, after a person approves it (below). - Never a sensitive variable or a platform credential (such as the staging and production database URLs or the Supabase service role key), nor any value that names or holds the credentials of a database production can run with. A reveal lists those names as withheld, with the reason.
The tool asks
A person decides
The tool reads once
project_secrets_history. A project allows 20 reveals and 20 approval requests an
hour.
What they can change
- Set a variable for one environment with
tier(development, staging or production). A name set without a tier applies to every environment, production included. - Generate values on the server instead of sending them, for up to 20 names at a time. Generated values are never shown or logged, are sensitive unless the tool says otherwise, and fill only names that have no value yet, unless the tool asks to rotate them.
- Check the version first with
expected_version: a change made against an older read of the variables is refused (409 stale_version), so two writers never overwrite each other. - Mark sensitive, one way only: an AI tool can make a variable write-only
(
project_secrets_mark_sensitive, orsensitive: truewhen it sets one), but only a person can make it readable again, on this page, with a new value. - Replace one environment’s variables with exactly the set it gives
(
project_secrets_replace). It runs as a dry run first, listing what would be added, changed, removed and kept, and is applied with the version that dry run read. Variables the tool could not see (sensitive ones, platform credentials, database URLs) are kept unless it names them, and a replace never changes the database connection Hiveku set up for the site. - Delete one variable at a time. Deleting every variable needs an owner’s or admin’s key and a confirmation.
takes_effect for each environment they
reach: live (the running site already uses it), applying (an update already under
way applies it in a moment) or next_deploy (the next deploy of that environment
applies it; always so for NEXT_PUBLIC_* values, which are built in). For the
preview, it says whether the running preview has it (applied), gets it when it next
starts (next_start), needs a restart (restart_needed), or keeps the old value
until it is rebuilt (next_rebuild).
Using Variables Locally
Three tools write a site’s values into a local file for your dev server. All three go through the same reveal, so a person approves every pull.- The tool shows an approval link (the VS Code extension opens the approval page). Anyone in the account who can see the site’s variables can approve it, you included. The tool waits up to 10 minutes and writes the file as soon as the approval lands.
- Development values go to
.env.local, staging values to.env.staging.local, and production values to.env.production.local. The file is readable by you only. - Sensitive variables and platform credentials are never written. Their names are listed in the file as comments, with the reason, so your local file is not silently incomplete. Set those by hand if your local build needs them.
- If no value comes back, nothing is written and an existing file is left as it is.
- Values the site gets from its linked environment groups are included, under the same rules; the site’s own value wins over a group’s.
.env.local as
Development values only, so it can never change Staging or Production.
Build-Time vs Runtime
This distinction matters.- Build-time (NEXT_PUBLIC_*)
- Runtime (everything else)
NEXT_PUBLIC_ are baked into the browser bundle at build time.- Used on the client (React components, browser JS)
- Visible to anyone who views source — never put secrets here
- Require a redeploy after changing the value
NEXT_PUBLIC_ANALYTICS_ID, NEXT_PUBLIC_API_URL, NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY.Auto-Injected Variables
Hiveku sets these for you automatically — you don’t need to add them:process.env.DATABASE_URL.
Never Hardcode Secrets
Bad:Reading Variables in Code
- Server-side (Node)
- Client-side (React)
- API routes
Verifying a Variable Is Set
After adding or changing a variable:Redeploy if it's NEXT_PUBLIC_*
Add a test route
/api/env-test:Hit the route
hasKey: true confirms the variable is injected.Never log the value itself
hasKey: true/false).Troubleshooting
process.env.MY_VAR is undefined in the browser
process.env.MY_VAR is undefined in the browser
NEXT_PUBLIC_* variables reach the browser. Rename to NEXT_PUBLIC_MY_VAR and redeploy. Regular env vars work server-side only.I added a variable but my app still errors 'undefined'
I added a variable but my app still errors 'undefined'
- You set it for the wrong environment. Check the scope dropdown on the row: a variable scoped to Staging does nothing in production
- It’s a build-time var (
NEXT_PUBLIC_*) and you haven’t redeployed yet — runtime vars reach the deployed site when you save (the save message says so if they could not), build-time vars need a full redeploy
The AI says it cannot read one of my variables
The AI says it cannot read one of my variables
An AI tool gave me a link to approve
An AI tool gave me a link to approve
A local pull did not write all my variables
A local pull did not write all my variables
A preview is missing a variable my live site has
A preview is missing a variable my live site has
I accidentally committed a secret to git
I accidentally committed a secret to git
I hit the size limit
I hit the size limit
Variable shows in Hiveku but not in my app
Variable shows in Hiveku but not in my app
process.env.NODE_ENV should
match the scope you set on the row. If it still fails, redeploy: occasionally
runtime injection lags a previous deploy.