---
title: "Variables"
url: https://docs.corefinity.com/guides/sites/code-and-deployments/variables-and-secrets
type: guide
last_updated: 2026-11-13
feature: deployment-variables
related:
  - https://docs.corefinity.com/api/reference/deployments/list-site-deployment-secrets.md
  - https://docs.corefinity.com/api/reference/deployments/create-site-deployment-secret.md
  - https://docs.corefinity.com/api/reference/deployments/update-site-deployment-secret.md
  - https://docs.corefinity.com/api/reference/deployments/delete-site-deployment-secret.md
  - https://docs.corefinity.com/api/reference/deployments/list-site-deployment-variables.md
  - https://docs.corefinity.com/api/reference/deployments/update-site-deployment-variable.md
  - https://docs.corefinity.com/mcp/tools/corestack_deployments_variables_list.md
  - https://docs.corefinity.com/mcp/tools/corestack_deployments_variable_set.md
  - https://docs.corefinity.com/mcp/tools/corestack_deployments_variable_delete.md
  - https://docs.corefinity.com/mcp/tools/corestack_deployments_variable_reveal.md
  - https://docs.corefinity.com/mcp/tools/corestack_deployments_secrets_list.md
  - https://docs.corefinity.com/mcp/tools/corestack_deployments_secret_set.md
---
# Variables

Give a site's deployment commands a value, such as a key or a URL, without putting it in the repository.

## Before you start

- You can open the site in **Managed Websites**. Anyone who can open a site can add, change, reveal and delete its variables.
- Each environment has its own variables: choose **Production** or **Staging** in the site header first.
- For a token that signs a build in to a private npm or Composer registry, use [Private registries](/guides/sites/code-and-deployments/registry-secrets).

## Add a variable

1. **Open the site's deployments**

   Go to **Managed Websites**, choose the site, then **Deployments** under **Code & backups**. On the **Variables** card, choose **Add variable**.

   _Screenshot: The Variables card with Add variable ringed: three variables with their name, value, source, where they are used and when they were updated. One value is masked and two are marked Shown in logs._

2. **Enter the name and value**

   Enter the **Name** in letters, digits and underscores: the `CF_` in front is added for you. Enter the **Value**, leave **Hidden** chosen unless the value is not secret, such as a flag or a URL, then choose **Save**.

   _Screenshot: The Add variable dialog: the name PAYMENT_WEBHOOK_KEY after the CF_ prefix, a value shown as dots, Hidden chosen under In deployment logs, and the Save button ringed.\_

The variable reaches every command of the environment's [pipeline](/guides/sites/code-and-deployments/pipeline-stages) from the next deployment, as `$CF_PAYMENT_WEBHOOK_KEY`. A **Hidden** value is masked wherever it appears in deployment logs.

**Used in** names the stages whose commands read the variable, or reads **Not used**. An environment holds up to 100 variables, and a value up to 2,048 characters on one line.

## Reveal, change or delete a variable

1. **Open the variable's menu**

   Open the variable's **…** menu and choose **Reveal**, **Edit** or **Delete**.

   _Screenshot: The Variables card with one variable's menu open, showing Reveal, Edit and Delete._

| Choice     | What it does                                                                                                               |
| ---------- | -------------------------------------------------------------------------------------------------------------------------- |
| **Reveal** | Shows the value, with **Copy**, until you close the dialog. Each reveal is recorded in the site's **Activity**.            |
| **Edit**   | Sets a new value or changes **In deployment logs**. Leave **Value** blank to keep the current one. The name cannot change. |
| **Delete** | Commands that read the variable get an empty value from the next deployment.                                               |

## Add a variable for every site

1. **Open the organisation's deployments**

   Go to **Organisation › Organisations**, choose your organisation, then **Deployments** under **Developers**. On the **Company variables** card, choose **Add variable**.

The variable reaches every build of your organisation's sites, and is never shown in logs. This needs an owner, or a role with **Edit Environment Deployment Pipeline**, and an organisation holds up to 100.

On a site, the row's **Source** names your organisation. Choose **Set for this environment** on that row to give the environment its own value, which wins.

## Automate this

**API:** [Update a site's deployment variable](https://docs.corefinity.com/api/reference/deployments/update-site-deployment-variable.md), scope `write`

```bash
curl -X PUT https://manage.corefinity.com/api/corestack/sites/1042/deployments/variables/API_TOKEN \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "value": "example-value-not-a-real-secret"
  }'
```

**MCP:** [`corestack_deployments_variable_set`](https://docs.corefinity.com/mcp/tools/corestack_deployments_variable_set.md), scope `write`

```json
{
  "name": "corestack_deployments_variable_set",
  "arguments": {
    "site_id": 4211,
    "name": "API_URL",
    "value": "https://api.example.com",
    "log_visibility": "shown"
  }
}
```

**Control Panel:** Managed Websites › your site › Code & backups › Deployments ([https://manage.corefinity.com/go/deployment-variables](https://manage.corefinity.com/go/deployment-variables))

## Related

- [Pipeline](/guides/sites/code-and-deployments/pipeline-stages): Change what a deployment runs.
- [Private registries](/guides/sites/code-and-deployments/registry-secrets): Sign builds in to npm and Composer registries.
- [Deployment log](/guides/sites/code-and-deployments/deployment-log): Find the command that failed.
