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

# Environment variables and secrets

## Overview

Environment variables let you pass sensitive information—API keys, passwords, authentication tokens—to your Projects without exposing them in your code. Use them to authenticate with external services, configure different settings for development versus production, or share configuration across multiple Projects.

## How it works

Environment variables are defined at either the Project level or workspace level.

**Variable hierarchy**: Project-level variables take precedence over workspace-level variables. If you define the same key at both levels, the Project-level value is used. This lets you set workspace-wide defaults while allowing individual Projects to override specific values.

**Environment targeting**: Each variable can target three contexts: Online IDE (development), deployed Projects (production), or both. Use different API keys or configuration for development versus production.

## Usage

### Project-level environment variables

Project environment variables are scoped to a single project. Manage them via the dashboard at `https://app.intuned.io/projects/{project-id}/env-vars` or with the CLI from your project directory.

### Create an environment variable

<Tabs>
  <Tab title="Dashboard">
    Select **New** and provide a key, value, and optional description. Choose where to expose it: Online IDE, deployed Projects, or both.

    <Note>
      Deployed environment variables require redeployment to take effect. When developing locally via CLI, see [Local development](#local-development).
    </Note>

    <img src="https://mintcdn.com/intuned-dev/bhb38akfgMoZ2D8J/assets/features/create-environment-variable.gif?s=61d8b2c68c14a880cb2d49c8eb36d89a" alt="Create Environment Variable" width="1440" height="1024" data-path="assets/features/create-environment-variable.gif" />

    To use different values per environment, create two variables with the same key and select the appropriate environment for each.

    <img src="https://mintcdn.com/intuned-dev/bhb38akfgMoZ2D8J/assets/features/multi-environment-variables.png?fit=max&auto=format&n=bhb38akfgMoZ2D8J&q=85&s=eb2f4f71321edb86dae25e9a6401877f" alt="Create Environment Variable Different Values" width="2880" height="2048" data-path="assets/features/multi-environment-variables.png" />
  </Tab>

  <Tab title="CLI">
    <Note>
      Run from your project directory (where Intuned Settings is located), or specify the project explicitly with `-p <project-name>`.
    </Note>

    ```bash theme={null}
    intuned platform env-vars create --key MY_VAR --value my-value
    ```

    Use `--envs` to target specific environments (comma-separated). Supported values: `PUBLISHED`, `AUTHORING`. Defaults to `PUBLISHED`.

    ```bash theme={null}
    # Create for both environments
    intuned platform env-vars create --key MY_VAR --value my-value --envs PUBLISHED,AUTHORING

    # With a description
    intuned platform env-vars create --key MY_VAR --value my-value --description "My API key"

    # Specify project explicitly
    intuned platform env-vars create -p my-project --key MY_VAR --value my-value
    ```

    To use different values per environment, create two variables with the same key using `--envs` to target each environment separately.

    <Note>
      Deployed environment variables require redeployment to take effect. When developing locally via CLI, see [Local development](#local-development).
    </Note>

    See [Env Vars Create](/main/05-references/cli/platform#env-vars-create) for all options.
  </Tab>
</Tabs>

### Edit an environment variable

<Tabs>
  <Tab title="Dashboard">
    Select **...** > **Edit** next to a variable to update its key, value, or environments.

    <img src="https://mintcdn.com/intuned-dev/bhb38akfgMoZ2D8J/assets/features/edit-environment-variable.gif?s=4dc77f0e90a0b7e71ae64a82a2f8df4c" alt="Edit Environment Variable" width="1440" height="1024" data-path="assets/features/edit-environment-variable.gif" />
  </Tab>

  <Tab title="CLI">
    <Note>
      Run from your project directory (where Intuned Settings is located), or specify the project explicitly with `-p <project-name>`.
    </Note>

    ```bash theme={null}
    intuned platform env-vars update MY_VAR --value new-value
    ```

    See [Env Vars Update](/main/05-references/cli/platform#env-vars-update) for all options.
  </Tab>
</Tabs>

### Delete an environment variable

<Tabs>
  <Tab title="Dashboard">
    Select **...** next to the variable you want to delete, then select **Delete**. Confirm when prompted.

    <img src="https://mintcdn.com/intuned-dev/bhb38akfgMoZ2D8J/assets/features/delete-environment-variable.gif?s=826642ac8a1c514a8b60b9dba5ae6cbc" alt="Delete Environment Variable" width="1440" height="1024" data-path="assets/features/delete-environment-variable.gif" />
  </Tab>

  <Tab title="CLI">
    <Note>
      Run from your project directory (where Intuned Settings is located), or specify the project explicitly with `-p <project-name>`.
    </Note>

    ```bash theme={null}
    intuned platform env-vars delete MY_VAR
    ```

    Add `--force` to skip the confirmation prompt:

    ```bash theme={null}
    intuned platform env-vars delete MY_VAR --force
    ```

    See [Env Vars Delete](/main/05-references/cli/platform#env-vars-delete) for all options.
  </Tab>
</Tabs>

### Workspace-level environment variables

Workspace environment variables are defined at the workspace level and exposed to all Projects in that workspace.

<Tabs>
  <Tab title="Dashboard">
    Go to `https://app.intuned.io/settings/env-vars` to manage workspace-level variables.

    Access them from within a project by selecting **Shared variables** in the Environment Variables tab.

    <img src="https://mintcdn.com/intuned-dev/bhb38akfgMoZ2D8J/assets/features/workspace-environment-variables-project.gif?s=0e7efba53d18ca0788c5fa701c4a39b5" alt="Workspace Level Environment Variables" width="1440" height="1024" data-path="assets/features/workspace-environment-variables-project.gif" />

    Alternatively, go to **side panel** > **Workspace Settings** > **Environment Variables**.

    <img src="https://mintcdn.com/intuned-dev/bhb38akfgMoZ2D8J/assets/features/workspace-environment-variables-side-panel.gif?s=54eb6542f0f2a76a27e2483d66b13f85" alt="Workspace Level Environment Variables Side Panel" width="1440" height="1024" data-path="assets/features/workspace-environment-variables-side-panel.gif" />
  </Tab>

  <Tab title="CLI">
    Manage workspace-level variables with the `workspace env-vars` subcommands:

    ```bash theme={null}
    # List workspace env vars
    intuned platform workspace env-vars list

    # Create a workspace env var
    intuned platform workspace env-vars create --key SHARED_KEY --value shared-value

    # Update a workspace env var
    intuned platform workspace env-vars update SHARED_KEY --value new-value

    # Delete a workspace env var
    intuned platform workspace env-vars delete SHARED_KEY
    ```

    See [Workspace Env Vars](/main/05-references/cli/platform#workspace-env-vars-list) for all options.
  </Tab>
</Tabs>

### Local development

When developing locally via CLI, the CLI reads `.env` files and system environment variables.

```env .env theme={null}
TEST_VAR=local_value
```

<Note>
  `.env` files are for local development only and aren't deployed. Before
  deploying, configure your environment variables using the dashboard or CLI
  commands above.
</Note>

## Related resources

<CardGroup cols={2}>
  <Card title="Online IDE" icon="code" href="/main/02-features/online-ide">
    Develop on Intuned with zero config
  </Card>

  <Card title="CLI" icon="terminal" href="/main/02-features/local-development-cli">
    Develop locally with your favorite IDE and tools
  </Card>
</CardGroup>
