---
title: "Environment variables"
description: "The variables that providersFromEnv() and forgesFromEnv() read."
canonical_url: "https://forges.link/reference/environment-variables"
---
# Environment variables

> The variables that providersFromEnv() and forgesFromEnv() read.

This page lists every variable that `providersFromEnv()` and `forgesFromEnv()` from `forges/env` read. Their names follow the pattern `FORGES_<KIND>_<FIELD>`. If you add `_<SUFFIX>` to a name, the variable belongs to another instance of the same forge. To learn how to use them, read [Configure from the environment](https://forges.link/guides/environment).

## Kinds

`<KIND>` is one of `GITHUB`, `GITLAB`, `BITBUCKET`, `FORGEJO`, `GITEA`, `GITEE`, `AZURE_DEVOPS`, `CURSOR_ORIGIN`, `TANGLED`, `PUSHIN`, `CLOUDFLARE_ARTIFACTS`, `SOURCEHUT`, `ENTIRE`, `GITBUCKET`, `GITCAFE` and `UPSTREAM`.

## Fields

`<FIELD>` is one of the following. Some of them only apply to certain forges, as the descriptions say.

| Field | Description |
| --- | --- |
| `TOKEN` | A token credential |
| `USERNAME`, `PASSWORD` | Basic credentials for Bitbucket and Azure DevOps |
| `APP_ID`, `PRIVATE_KEY`, `INSTALLATION_ID` | App credentials. GitHub and Cursor Origin. Write line breaks in `PRIVATE_KEY` as `\n` |
| `IDENTIFIER`, `PASSWORD`, `PDS` | Tangled app password credentials, and the PDS to use |
| `ORGANIZATION` | Azure DevOps organisation. Required for that forge |
| `ACCOUNT_ID` | Cloudflare account that holds the Artifacts namespaces. Required for that forge |
| `BASE_URL` | The API base URL of the instance |
| `INSTANCE`, `INSTANCE_VERSION` | The host to use in refs, and the version of the instance |
| `API_URL`, `NOTIFICATIONS_URL` | Tangled service URLs |
| `WEBHOOK_SECRET` | The secret used to verify deliveries |
| `WEBHOOK_PUBLIC_KEY` | The ed25519 public key used to verify deliveries. Sourcehut, and only for a self-hosted instance |
| `READ_ONLY` | `1` or `true` creates the provider with `readOnly: true` |
| `ENABLED` | `1` or `true` creates an anonymous provider when no credential is set. `0` or `false` skips the set |
| `DEMO_REPO` | A repository as `owner/name`, for tools that need one to show. GitLab owners can contain slashes. A set with a `DEMO_REPO` is anonymous when it has no credential |

## What each forge needs

A set of variables creates a provider when it contains one of the credentials that its forge accepts. Without a credential, a set can still create an anonymous provider if it has `ENABLED` or `DEMO_REPO`, except for forges that don't allow anonymous access. The optional fields take effect together with a credential. The following table shows what each forge needs and what happens without one.

<forge-requirements>

| Forge | Credentials | Optional | Without a credential |
| --- | --- | --- | --- |
| GitHub | `TOKEN`, or `APP_ID` and `PRIVATE_KEY` | `INSTALLATION_ID` with `APP_ID` and `PRIVATE_KEY` | Anonymous reads with `ENABLED` or `DEMO_REPO`. Skipped otherwise |
| GitLab, Forgejo, Gitea, Gitee, Pushin.eu, GitCafe, Upstream | `TOKEN` | None | Anonymous reads with `ENABLED` or `DEMO_REPO`. Skipped otherwise |
| Bitbucket | `TOKEN`, or `USERNAME` and `PASSWORD` | None | Anonymous reads with `ENABLED` or `DEMO_REPO`. Skipped otherwise |
| Azure DevOps | `ORGANIZATION`, and `TOKEN`, or `USERNAME` and `PASSWORD` | None | Anonymous reads with `ENABLED` or `DEMO_REPO`. Skipped otherwise |
| Cursor Origin | `TOKEN`, or `APP_ID` and `PRIVATE_KEY` | `INSTALLATION_ID` with `APP_ID` and `PRIVATE_KEY` | Webhooks only with `ENABLED`. Skipped otherwise |
| Tangled | `IDENTIFIER` and `PASSWORD` | `PDS`, `API_URL` and `NOTIFICATIONS_URL` | Anonymous reads |
| Cloudflare Artifacts | `ACCOUNT_ID`, and `TOKEN` | None | Skipped, even with `ENABLED` |
| Sourcehut, Entire | `TOKEN` | None | Skipped, even with `ENABLED` |
| GitBucket | `BASE_URL`, and `TOKEN` | None | Anonymous reads with `ENABLED` or `DEMO_REPO`. Skipped otherwise |

</forge-requirements>

If you aren't sure which variables or token scopes you need for a task, the [credentials picker](https://forges.link/guides/environment#pick-the-variables-for-a-task) works it out for you.


## Sitemap

See the full [sitemap](https://forges.link/sitemap.md) for all pages.
