> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hiveku.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Store an API Key or Setting for Your Site

> Keep an API key or a setting out of your site's code: add it as an environment variable, choose where it applies, and mark secrets as sensitive

Some things your site's code needs should never be written into the code itself: the API key for a service you use, or a setting you want to change without editing pages. An environment variable holds one of these under a name. Hiveku stores it encrypted and hands it to your site when it builds and runs, so the code reads the name and never sees the value written down.

This guide adds a setting to Northwind's site: the smallest wholesale order, in pounds.

## Open the site's variables

Open the website, click its name at the top of the page, then **Settings**. On the **Environment Variables** card, click **Manage**.

![The Environment Variables card: 0 variables configured, Last updated 10/21/2026, with Manage outlined](https://mintcdn.com/locusdigital/PB9Cc2oktwkAHVeF/images/how-tos/websites/sk-00-settings-card-closeup.webp?fit=max\&auto=format\&n=PB9Cc2oktwkAHVeF\&q=85\&s=6f5921d5d5079fc8839c7ac35b9cf8ad)

## Add a variable

**1. Click Add Variable**

Scroll to **Environment Variables** and click **Add Variable**. A new row appears.

![The Refresh, Import and Add Variable buttons, with Add Variable outlined](https://mintcdn.com/locusdigital/PB9Cc2oktwkAHVeF/images/how-tos/websites/sk-01-add-variable-closeup.webp?fit=max\&auto=format\&n=PB9Cc2oktwkAHVeF\&q=85\&s=1e2d1d9b6914414aae471a924d8d8019)

**2. Name it, give it a value, and choose where it applies**

Type the **name** your site's code uses, in capitals with underscores, such as `WHOLESALE_MIN_ORDER_LBS`, then the **value**. The value is hidden as you type; the eye shows it.

The list next to it sets where the variable applies: **All Environments**, or only **Development**, **Staging** or **Production**, or **Development and Staging**, or **Staging and Production**. Use different values in each, for example a test key for Development and the real one for Production, by adding the name once for each.

Click **Save changes**.

![A new row: WHOLESALE\_MIN\_ORDER\_LBS, a hidden value, Development, Sensitive unticked, outlined, and 1 to add with Save changes, outlined](https://mintcdn.com/locusdigital/PB9Cc2oktwkAHVeF/images/how-tos/websites/sk-02-new-variable-closeup.webp?fit=max\&auto=format\&n=PB9Cc2oktwkAHVeF\&q=85\&s=eadb587e24ffc258903eceb60fa01d21)

> [!WARNING]
>
> At the moment the name box keeps only the first letter you type and then lets go. Type the name somewhere else and paste it in, or use **Import** (below). The value box is not affected.

The variable is saved and passed to your site where it already runs, and every build after that gets it too. If the running site can't be updated, a message says so; deploying again applies it.

![The saved row: WHOLESALE\_MIN\_ORDER\_LBS, its hidden value, Development, outlined](https://mintcdn.com/locusdigital/PB9Cc2oktwkAHVeF/images/how-tos/websites/sk-03-saved-closeup.webp?fit=max\&auto=format\&n=PB9Cc2oktwkAHVeF\&q=85\&s=b48cbcf1822f9dd3cf26e317e4ce6a5a)

## Mark a secret as sensitive

Tick **Sensitive** on a row that holds a password or a private API key. The value then becomes write only: after you save, nobody can read it again in Hiveku, including you, your teammates, Hiveku staff and AI agents. Your site still gets the real value when it builds and runs. If you lose it, replace it with a new one.

![Mark this variable as sensitive? Sensitive variables are write only, after you save the value is hidden everywhere in Hiveku and cannot be revealed again, with the list of who this applies to, and Mark as sensitive, outlined](https://mintcdn.com/locusdigital/PB9Cc2oktwkAHVeF/images/how-tos/websites/sk-04-sensitive-closeup.webp?fit=max\&auto=format\&n=PB9Cc2oktwkAHVeF\&q=85\&s=36dd0d60fb72b44472b3b0aae5485ef8)

Once saved, **Sensitive** can't be turned off. Northwind's setting isn't secret, so it clicked **Cancel** here.

> [!WARNING]
>
> Never put a secret in a variable whose name starts with `NEXT_PUBLIC_`. Those values are built into your pages, so anyone visiting the site can read them.

## Remove a variable

Click the trash can at the end of its row, then **Mark for deletion**. The row is crossed out until you click **Save changes**, and **Undo** brings it back before then.

![Delete WHOLESALE\_MIN\_ORDER\_LBS? This removes WHOLESALE\_MIN\_ORDER\_LBS\_DEV when you save, with Mark for deletion, outlined](https://mintcdn.com/locusdigital/PB9Cc2oktwkAHVeF/images/how-tos/websites/sk-05-delete-closeup.webp?fit=max\&auto=format\&n=PB9Cc2oktwkAHVeF\&q=85\&s=010f7e942fea98428169983b4ae3b8c0)

**Save changes** asks once more, because the value is removed for good. A variable for one environment is stored with that environment's ending, such as `_DEV`, which is the name the window shows.

![Save and delete? This permanently removes 1 stored key(s): WHOLESALE\_MIN\_ORDER\_LBS\_DEV, with Save changes, outlined](https://mintcdn.com/locusdigital/PB9Cc2oktwkAHVeF/images/how-tos/websites/sk-06-save-delete-closeup.webp?fit=max\&auto=format\&n=PB9Cc2oktwkAHVeF\&q=85\&s=9f606c0b040b163828a3e4919df42928)

Your running site keeps the old value until you deploy again. Northwind removed its setting again after this guide.

## Good to know

* **Many at once:** **Import** takes a list of `NAME=value` lines, such as the contents of a `.env` file, and adds them all.
* **The same keys on several sites:** an environment group holds variables that several sites share. Link one under **Environment groups** on this page; a site's own variable with the same name wins.
* **Your database:** **Database Connections** at the top of the page sets which database each environment uses.
* **More:** [Configure Environment Variables](/how-tos/env-vars) covers how your site's code reads them.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.