---
modificationDate: February 24, 2026
title: Create and manage environment variables in EAS
description: Learn how to create, scope, and consume environment variables with EAS dashboard and EAS CLI.
---

<AgentInstructions>

## Submitting Feedback

If this page contains errors, outdated information, or gaps that blocked you from completing a task, report it so the docs can be improved:

curl -X POST https://api.expo.dev/v2/feedback/docs-send -H 'Content-Type: application/json' -d '{"url":"/eas/environment-variables/manage/","feedback":"🤖 Agent feedback: <specific, actionable description>"}'

Only submit when you have something specific and actionable to report.

</AgentInstructions>

# Create and manage environment variables in EAS

Learn how to create, scope, and consume environment variables with EAS dashboard and EAS CLI.

> For the complete documentation index, see [llms.txt](/llms.txt). Use this file to discover all available pages.

The following sections cover how to create, scope, and consume environment variables with EAS dashboard and EAS CLI.

## Create environment variables

-   [**Choose an environment or multiple environments**](/eas/environment-variables#available-environments): `development`, `preview`, and `production` are available by default. A variable can be reused across them or customized per environment.
-   [**Choose scope**](/eas/environment-variables#scope): Project-wide variables apply to one project. Account-wide variables can be reused across projects and are merged with project variables at build time.
-   [**Choose visibility**](/eas/environment-variables#visibility-settings-for-environment-variables): Use **secret** for values that should never leave EAS servers, **sensitive** for values that may be revealed locally, and **plain text** for non-sensitive values.

### Create variables in the dashboard

To create a new environment variable on EAS servers, in your project dashboard, you can navigate to the **Project settings** > [**Environment variables**](https://expo.dev/accounts/%5Baccount%5D/projects/%5Bproject%5D/environment-variables) and then click on the **Add Variables** button.

Use the [environment variables creation form](https://expo.dev/accounts/%5Baccount%5D/projects/%5Bproject%5D/environment-variables) page to set the name, value, environment(s), visibility, and optional description.

Created variables appear in the list with their scope, visibility, and environment tags. Based on the environment variables in this example, the list may look like this:

In the above example list:

-   The `SENTRY_AUTH_TOKEN` variable is a sensitive environment variable. It is used to authenticate Sentry to upload source maps after builds and updates, and has to be accessible outside of EAS servers.
-   The `GOOGLE_SERVICES_JSON` variable is a secret environment variable and uses an uploaded file. It is used to authenticate Google to access the Google Services JSON file, and has to be stored securely on EAS servers. This uploaded JSON file is typically added to your project's **.gitignore**.
-   All other variables, such as `APP_VARIANT` and `EXPO_PUBLIC_API_URL`, are plain text environment variables.

### Create variables with EAS CLI

Use `eas env:create` to add variables and `eas env:list` to verify what is set.

```sh
eas env:create --name EXPO_PUBLIC_API_URL --value https://example.app/staging --environment preview --visibility plaintext
eas env:list --environment preview
```

## Using environment variables in your code

### Client-side values

The environment variables with the [`EXPO_PUBLIC_`](/guides/environment-variables) prefix are available as `process.env` variables in your app's code. You can use them dynamically to configure your app behavior based on their values:

```tsx
import { Button } from 'react-native';

function Post() {
  const apiUrl = process.env.EXPO_PUBLIC_API_URL;

  async function onPress() {
    await fetch(apiUrl, {
      ... 
    });
  }

  return <Button onPress={onPress} title="Post" />;
}
```

In the above example, `EXPO_PUBLIC_API_URL` is used to dynamically set the API URL for the fetch request.

> Do not put secrets in `EXPO_PUBLIC_` variables. Everything in client bundles is readable by end users.

### Build-time and app config

Other variables that are without the `EXPO_PUBLIC_` prefix can be used during [app config](/workflow/configuration) resolution to configure your app's behavior. For example, the `APP_VARIANT` variable is used to determine the app name, package name, and bundle identifier for the selected [app variant](/build-reference/variants):

Use non-prefixed variables in dynamic app config. Keep visibility at least **sensitive** if you need to resolve config locally (plain text and sensitive are readable in EAS CLI; secrets stay on the server).

```js
const IS_DEV = process.env.APP_VARIANT === 'development';
const IS_PREVIEW = process.env.APP_VARIANT === 'preview';

const getUniqueIdentifier = () => {
  if (IS_DEV) {
    return 'com.yourname.stickersmash.dev';
  }

  if (IS_PREVIEW) {
    return 'com.yourname.stickersmash.preview';
  }

  return 'com.yourname.stickersmash';
};

const getAppName = () => {
  if (IS_DEV) {
    return 'StickerSmash (Dev)';
  }

  if (IS_PREVIEW) {
    return 'StickerSmash (Preview)';
  }

  return 'StickerSmash: Emoji Stickers';
};

export default {
  name: getAppName(),
  ... 
  ios: {
    bundleIdentifier: getUniqueIdentifier(),
    ... 
  },
  android: {
    package: getUniqueIdentifier(),
    ... 
  },
};
```

### Secrets and file variables

An environment variable such as `GOOGLE_SERVICES_JSON` is a secret file variable that is not readable outside of EAS servers and is used to provide the git ignored **google-services.json** file to an EAS Build job. To use it in the app config, you can use the `process.env` variable and provide a fallback value in case the variable is not set (for local development when you usually have it inside your project's repository):

```js
export default {
  android: {
    googleServicesFile: process.env.GOOGLE_SERVICES_JSON ?? '/local/path/to/google-services.json',
  },
};
```

## Manage environment variables

You can use [EAS dashboard](https://expo.dev/accounts/%5Baccount%5D/projects/%5Bproject%5D/environment-variables) in your project or account to create, update, and delete environment variables.

You can also use EAS CLI to manage them. The following commands are provided as examples for the `production` environment. When using these commands, replace `production` with the environment you want to manage.

```sh
eas env:create --name EXPO_PUBLIC_API_URL --value https://example.app/staging --environment production --visibility plaintext
eas env:update --name EXPO_PUBLIC_API_URL --value https://example.app/staging --environment production --visibility plaintext
eas env:delete
eas env:list --environment production
eas env:pull --environment production
```

> **Tip:** See the [EAS CLI command reference](https://github.com/expo/eas-cli/blob/main/packages/eas-cli/README.md) for more information about the above commands.

### Pull variables for local development

The efficient way to use EAS environment variables for local development is to pull them into a **.env** file using the `eas env:pull --environment environment-name` command:

For example, to pull the environment variables for the `production` environment into a **.env** file, you can run:

```sh
eas env:pull --environment production
```

The created file may look like the following:

```bash
# Environment: production

APP_VARIANT=development
EXPO_PUBLIC_API_URL=https://staging.my-api-url.mycompany.com
# GOOGLE_SERVICES_JSON=***** (secret variables are not available for reading)
SENTRY_AUTH_TOKEN=token
```

> **Tip:** Keep generated **.env** files in **.gitignore** to avoid leaks and precedence conflicts between local and cloud jobs.

You can also use the **Export** option in the EAS dashboard to download the file and store it inside your project.

## Custom environments

> Creating custom environments is available for [Enterprise and production](/billing/plans#plans) plans.

The three default environments are sufficient for most use-cases, but if your project relies on complex workflows and requires the flexibility to create more environments, using custom environments may come in handy.

### Create a custom environment in EAS dashboard

To create a custom environment in EAS dashboard:

-   In your project, navigate to the **Project settings** > [**Environment variables**](https://expo.dev/accounts/%5Baccount%5D/projects/%5Bproject%5D/environment-variables) and then click on the **Add Variables** button.
-   Under **Environments**, click the **plus (+) icon** to enter a name for a custom environment.

-   After creating the environment, it will be pre-selected under the **Custom environments** section.
-   As long as there is at least one environment variable linked to this environment, it will show up as a selectable option for all environment variables for that account or project.

### Create a custom environment with EAS CLI

To assign an environment variable to custom environments, use your custom environment name in place of the environment. For example, the command below creates a new variable `EXPO_PUBLIC_API_URL` and assigns it to the custom `staging` environment:

```sh
eas env:create --name EXPO_PUBLIC_API_URL --value https://example.app/staging --environment staging --visibility plaintext
```
