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

# Environment Variables

> All environment variables that configure Relic's behavior.

Relic reads the following environment variables. None of them are required for normal usage.

## Authentication

| Variable | Description | Default |
| - | - | - |
| `RELIC_SERVICE_TOKEN` | Service account token for CI/CD. Handles both authentication and decryption. Recommended over API keys. | None |
| `RELIC_OIDC_TOKEN` | OIDC token for identity verification. Auto-detected in GitHub Actions and GitLab CI. Set manually for other providers. | Auto-detected |
| `RELIC_PASSWORD` | Master password for secret decryption. Used with `RELIC_API_KEY` in CI/CD (deprecated). | Read from keychain or file |
| `RELIC_API_KEY` | API key for CI/CD authentication (deprecated). Use `RELIC_SERVICE_TOKEN` instead. | None |
| `RELIC_PROJECT_ID` | Project ID. Overrides `relic.toml` and `--project` flag. | Read from `relic.toml` |

## Server

| Variable | Description | Default |
| - | - | - |
| `CONVEX_URL` | Convex backend URL. Only needed for self-hosted or development. | Production URL (built-in) |
| `CONVEX_SITE_URL` | Convex HTTP actions URL. Only needed for self-hosted or development. | Production URL (built-in) |
| `SITE_URL` | Web dashboard URL. Only needed for self-hosted or development. | Production URL (built-in) |

<Note>
  You do not need to set `CONVEX_URL`, `CONVEX_SITE_URL`, or `SITE_URL` when using Relic's hosted
  service. These are only required for self-hosted or local development setups.
</Note>

## Logging

| Variable | Description | Default |
| - | - | - |
| `RELIC_LOG` | Log level: `debug`, `info`, `warn`, `error`, `off` | Dev: `info`, Prod: `warn` |
| `RELIC_LOG_FILE` | Override log file path. | Dev: `~/.config/relic/logs/debug.log`, Prod: `~/.config/relic/logs/relic.log` |

## Telemetry

| Variable | Description | Default |
| - | - | - |
| `RELIC_TELEMETRY` | Set to `false` to disable telemetry. | Enabled |
| `RELIC_POSTHOG_KEY` | PostHog API key. Telemetry is disabled if empty. | Empty |
| `RELIC_TELEMETRY_URL` | PostHog proxy host. | `https://telemetry.withrelic.com` |

## Runtime

| Variable | Description | Default |
| - | - | - |
| `DEV` | Set to `true` to enable development mode. Switches server URLs to localhost, enables console logging, debug log file, and disables telemetry. | Not set |
| `CI` | When set (any value), disables telemetry and console logging. Detected automatically by most CI providers. | Not set |

## CI/CD Quick Reference

The recommended way to run Relic in a CI/CD pipeline using a service account:

```bash theme={null}
RELIC_SERVICE_TOKEN=rsk_...   # Service token from `relic service-account create`
```

```bash theme={null}
relic run -e production -- npm run deploy
```

<Tip>Service accounts are scoped to a project, so `RELIC_PROJECT_ID` is not needed.</Tip>


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