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

# Environment variables

> Store the configuration and secrets your backend code needs, such as API URLs, sender addresses, and keys. Variables belong to an environment, secrets are encrypted and write-only, and changes reach your services the next time you deploy.

Environment variables hold values your code reads at runtime instead of hard-coding them: an API URL, a sender address, a template ID. Archie also lets you store **secrets**, which are values like keys and tokens that must stay private.

The variables you set here are the same ones the [Logic](https://archie.com/docs/backend/logic.md) services in the environment receive when they deploy.

## Open the page

Go to **Backend → Settings → Environment Variables**. The **Settings** section is at the end of the Backend Console navigation. Its sidebar has a **Project** group with **API Keys**, **Environment Variables**, **Network**, and **Danger Zone**.

![The Environment Variables page with a table of variables whose values are masked, an empty row for a new variable, and a Secrets section.](https://mintcdn.com/archie-e998dbf6/JW67AKv9r3EIl9M1/images/43-env-vars-page.png?fit=max\&auto=format\&n=JW67AKv9r3EIl9M1\&q=85\&s=7bbae0a9cb30ce2fb4519d4c9d34cd01)

The page shows the variables of the [environment](https://archie.com/docs/backend/environments.md) selected in the environment menu on the right of the Backend Console, such as `master`. Switch environments to see that environment's variables.

## Variables

The first table lists your variables by **Key** and **Value**. Archie masks every value. Each row also has an eye icon and an X icon.

### Add a variable

1. Type a name in the empty **Add Key** field at the bottom of the table.
2. Type its value in **Add Value**. You can also click **Add Variable** to add a row.
3. Save your changes.

Use a key that starts with a letter and contains only letters, digits, dots, dashes, and underscores, up to 253 characters. Archie rejects keys that don't fit.

### Edit or remove a variable

* To change a value, edit it in its row and save.
* To remove a variable, click the X icon at the end of its row and save. Archie asks you to confirm before it permanently deletes the values.

## Secrets

Scroll down to the **Secrets** section. Archie describes secrets as "Encrypted and write-only: values are never shown again." Archie injects them into the service container as secret environment variables at deploy time.

Use secrets for API keys, tokens, and passwords. The table lists the names of the secrets you stored, with masked values.

### Add a secret

1. Click **Add Secret**.
2. Enter a name and a value. Both are required.
3. Save your changes.

A secret name can contain letters, numbers, hyphens, underscores, and dots, and each name can be used only once.

> [!WARNING]
>
> Saving secrets replaces the whole set. Archie can't read the values it stored, so when you change secrets, re-enter the value of every secret you want to keep, or remove the ones you don't. Check the on-screen hint before you save.

> [!NOTE]
>
> If you delete every secret, services that read them fail after their next deploy.

## When changes take effect

Saving updates the stored values. It doesn't restart a running service. Services pick up the new values the next time you deploy them. After you save, open the service and click **Deploy**. See [Deployments](https://archie.com/docs/backend/logic/deployments.md).

If you leave the page with unsaved changes, Archie warns you and lets you save or leave without saving.

## Where the variables are used

* **Logic services.** Every service in the environment receives these variables when it deploys. The **Environment variables** tab of a service shows the same list. See [Logic environment variables](https://archie.com/docs/backend/logic/environment-variables.md).
* **New environments.** When you create an environment, you can choose to copy its variables, keys and values included. See [Creating an environment](https://archie.com/docs/backend/environments/creating.md).

## FAQ

> **Are my values encrypted?**
>
> Archie describes **secrets** as encrypted and write-only. It doesn't make that claim for plain variables, which it masks in the editor. Put anything sensitive in **Secrets**.

> **Can I see a secret again after I save it?**
>
> No. Secrets are write-only. To change one, enter a new value.

> **Can one service have its own values?**
>
> Not yet. The service's own **Environment variables** tab says per-function variables are coming later.

> **Where do I put credentials for Stripe, SendGrid, and other integrations?**
>
> Use the integration's own settings. See [Integrations](https://archie.com/docs/backend/integrations.md).


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