# Deployment environment variables

{% hint style="info" %}
**CloudCode version compatibility**

To use deployment environment variables, please upgrade your CloudCode task to version 1.11.1.
{% endhint %}

You can set up environment variables per deployment. These env variables are accessible from CloudCode tasks.

To create a new environment variable, open the Deployment settings for a specific deployment, and go to the Environment Variables tab.

Then create the environment variable on each deployment you need it with the corresponding value.&#x20;

Sensitive environment variables can be masked as follows:

<figure><img src="https://2865107717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9TCHLR67eLHBOjPvHhud%2Fuploads%2F5qWSLtpYHptZROhMUNZP%2FScreenshot%202022-08-31%20at%2011.28.00.png?alt=media&#x26;token=73d6a790-bd76-456f-b5c1-6987429ab4a9" alt=""><figcaption></figcaption></figure>

You can clone variables from other deployments to save time. Note, however, that masked variables cannot be cloned.

### Using environment variables in CloudCode

Environment variables are available in CloudCode using the following syntax:

```
process.env.VARIABLE_NAME
```

In other words, for the example in the screenshot above, you can use the following to access the `xyz_app_credentials` environment variable:

```
process.env.xyz_app_credentials
```

When the CloudCode task runs in a specific deployment, it will read the value of the environment variable that is saved in the deployment settings for that deployment.
