# Environment variables

> Every environment variable Relia's SDKs and command-line tools read, which SDK reads it, what it does and its default.

Section: Reference · Page: https://tryrelia.com/docs/environment-variables · Last checked against the product: 2026-11-01

The variables your app and build can set to configure Relia. "Node" = `relia-sdk` on a server (`relia-sdk/node`), "Python" = `relia-sdk` on PyPI, "PHP" = `tryrelia/relia` (Laravel and plain PHP), "Edge" = `relia-sdk/edge` (Supabase Edge Functions, Deno, Cloudflare Workers, Vercel Edge). Switches turn off with `0`, `false`, `off` or `no` unless a row says otherwise.

> **Note:** the browser SDK (`Relia.init`) reads no environment variables: its settings are the options in `src/relia.ts`. The Node.js server SDK takes `serviceName` and `projectId` from `relia.tracing.js` (or `instrumentation.ts`), which `init` writes for you. The Python SDK also reads `.env` and `.env.local` in the current folder for variables not already set. Edge reads each variable from the function's options, then the Workers `env` bindings, then `Deno.env` / `process.env`.

## Project and identity

| Variable | SDKs | What it does | Default |
|---|---|---|---|
| `RELIA_PROJECT_ID` | Python, PHP, Edge, Node (AI runs, CLI) | Your Relia project id (24 characters; on your project page under **Setup Guide & SDK**). | None. PHP sends nothing without it. |
| `RELIA_KEY` | Node, Python, PHP, Edge | The project key (`relia_live_…`), sent as the `X-Relia-Key` header. A wrong key for the project is refused; a missing one is accepted. | None |
| `RELIA_SERVICE_NAME` | Python, PHP, Edge, Node (`system`) | The service name shown in Relia. | Python: `OTEL_SERVICE_NAME`, else `backend`. PHP: your `APP_NAME` in lower case with dashes, else `php-app`. Edge: the first part of the URL path, else `edge-function`. |
| `OTEL_SERVICE_NAME` | Python | Used when `RELIA_SERVICE_NAME` is not set. | None |
| `RELIA_ENV` | Python, PHP, Edge | The environment name (production, staging…). Relia hides hosts from development environments by default. | Python: `ENVIRONMENT`, else `APP_ENV`, else `production`. PHP: `APP_ENV`, else `production`. Edge: `production`. |
| `NODE_ENV` | Node | The environment name on Node.js servers. | `development` |

## Where data goes

| Variable | SDKs | What it does | Default |
|---|---|---|---|
| `RELIA_OTLP_ENDPOINT` | Node, Python, PHP, Edge, CLI | Where traces go. `/v1/traces` is added when missing (Node, PHP). App logs go to the same address with `/v1/logs`. | `https://devotel.tryrelia.com/v1/traces` |
| `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`, `OTEL_EXPORTER_OTLP_ENDPOINT` | Python | Used, in that order, when `RELIA_OTLP_ENDPOINT` is not set. | None |
| `RELIA_API_URL` | Node, Python, PHP, Edge, CLI | Relia's API address: SDK settings, AI runs, the Laravel `@reliaScript` browser part, and the CLI. | `https://devreliaapi.tryrelia.com` |

## Versions and deploys

| Variable | SDKs | What it does | Default |
|---|---|---|---|
| `RELIA_RELEASE` | Node, Python, PHP, Edge, CLI, Vite plugin | The version of the running build, so Relia can tell deploys apart. Also the release name for source map uploads. | Detected (see below) |
| `SERVICE_VERSION`, `OTEL_SERVICE_VERSION` | Node, Python, PHP | Used, in that order, when `RELIA_RELEASE` is not set. | None |

With none of these set, the version is detected: first the commit your CI or host exposes (`GITHUB_SHA`, `VERCEL_GIT_COMMIT_SHA`, `RENDER_GIT_COMMIT`, `HEROKU_SLUG_COMMIT`, `SOURCE_VERSION`, `CF_PAGES_COMMIT_SHA`, `RAILWAY_GIT_COMMIT_SHA`, `CI_COMMIT_SHA`, `BITBUCKET_COMMIT`, `GIT_COMMIT`; PHP also `FORGE_SITE_BRANCH_COMMIT` and `LARAVEL_CLOUD_COMMIT`), then the checked-out commit in `.git`, then your package version.

## What is collected

| Variable | SDKs | What it does | Default |
|---|---|---|---|
| `RELIA_ENABLED` | PHP, Edge | Switch: off sends nothing. | On |
| `RELIA_TRACING_DISABLED` | PHP | Any value turns Relia off. | Not set |
| `RELIA_LOGS` | Node, Python, PHP | Switch for sending your app's warning and error log lines. | On |
| `RELIA_LOG_LEVEL` | Python, PHP | Lowest log level sent. | Python `WARNING`, PHP `warning` |
| `RELIA_SYSTEM_METRICS` | Node, Python | Switch for CPU, memory and disk of the machine. Node turns off only with `false`. | On |
| `RELIA_SYSTEM_INTERVAL` | Node, Python | Seconds between machine readings (at least 5). | `30` |
| `RELIA_DISABLE_INSTRUMENTATIONS` | Node, Python | Comma-separated libraries not to trace. Node: `fastify`, `bullmq`, `mcp`. Python: `requests`, `httpx`, `aiohttp`, `celery`, `botocore`, `boto3sqs`, `mcp`. | None |
| `RELIA_DB_BACKGROUND` | Node, Python | `1`, `true`, `yes` or `on` also records database calls made outside a request or job. | Off |
| `RELIA_QUERIES` | PHP (Laravel) | Switch for database queries. | On |
| `RELIA_HTTP_CLIENT` | PHP (Laravel) | Switch for outgoing HTTP calls. | On |
| `RELIA_QUEUE` | PHP (Laravel) | Switch for queue jobs. | On |
| `RELIA_REMOTE_SETTINGS` | Node, Python | Switch for reading the project's [SDK settings](https://tryrelia.com/docs/sdk-settings.md) from Relia (every 10 minutes). | On |

## AI calls and agent runs

| Variable | SDKs | What it does | Default |
|---|---|---|---|
| `RELIA_AI_CAPTURE` | Node, Python, Edge | Switch for recording calls to OpenAI, Anthropic, Gemini and compatible APIs as AI runs. | On |
| `RELIA_AGENT_ID` | Node, Python, Edge | The AI agent's id in Relia. | Node: derived from the agent name. Edge: the service name. |
| `RELIA_AGENT_NAME` | Node, Python, Edge | The AI agent's name in Relia. | The service or package name |
| `RELIA_AGENT_ENDPOINT` | Node, Python, Edge, CLI | Where AI runs are sent. | `https://devreliaapi.tryrelia.com/api/v1/agents/runs` |
| `RELIA_DEBUG` | Node | Any value except `0`, `false` or `off` prints a line per AI run. | Off |

## Serverless functions

| Variable | SDKs | What it does | Default |
|---|---|---|---|
| `RELIA_SERVERLESS` | Node, Python | `1`, `true` or `on` forces serverless mode (send before answering, no machine metrics). Detected by itself on Google Cloud / Firebase Functions, Cloud Run and AWS Lambda (Node also Vercel and Netlify). | Off |
| `RELIA_FUNCTION_NAME` | Node, Python | The function's name when serverless mode is forced. | `function` |
| `RELIA_FLUSH` | Node, Python, Edge | Node and Python: `after` keeps sending in the background instead of before each response. Edge: `before` always sends before answering (use it with `supabase functions serve`). | Node and Python: before answering in serverless mode, in the background otherwise. Edge: after answering when the platform keeps the function alive for it. |
| `RELIA_FLUSH_TIMEOUT_MS` | Node, Python | Longest wait to send before answering, in milliseconds (Node: 100 to 5000). | `1000` |

## Command-line tools and builds

| Variable | Used by | What it does | Default |
|---|---|---|---|
| `RELIA_TOKEN` | `sourcemaps upload`, Vite plugin | The upload-only token for source maps. Also read from `.env.local` / `.env` in the folder. Set it in your host's environment variables for hosted builds. | The login saved by `init` |
| `RELIA_MCP_TOKEN` | `mcp`, `mcp install` | An MCP token (`relia_mcp_…`) for token mode. | `~/.relia/mcp.json` |
| `RELIA_MCP_URL` | `mcp`, `mcp install` | Relia's MCP address. | `mcp`: the address saved by `mcp install`, else `https://devreliaapi.tryrelia.com/mcp`. `mcp install`: `RELIA_API_URL` + `/mcp`, else `https://devreliaapi.tryrelia.com/mcp`. |
| `RELIA_SESSION_ENDPOINT` | `init` | The browser endpoint written into `src/relia.ts`. | Relia's cloud API |
| `RELIA_APP_URL` | CLI | The Relia app address used in printed links. | `https://app.tryrelia.com` |

## Next

- [CLI reference](https://tryrelia.com/docs/cli.md)
- [Control what Relia collects](https://tryrelia.com/docs/sdk-settings.md)
- [Relia shows no data](https://tryrelia.com/docs/no-data.md)
- [Monitor serverless and edge functions](https://tryrelia.com/docs/edge-runtimes-setup.md)

---
All Relia docs for AI assistants: https://tryrelia.com/llms.txt (index) · https://tryrelia.com/llms-full.txt (everything in one file)
