> ## Documentation Index
> Fetch the complete documentation index at: https://nextjs-egg.nyxel.my.id/llms.txt
> Use this file to discover all available pages before exploring further.

# Variables

> All panel variables you can configure for your Next.js server.

Each variable below maps directly to an environment variable available inside your server container. You can edit them from the **Startup** tab of your server in the Pterodactyl or Pelican panel.

## Git & Deployment

<ParamField body="GIT_URL" type="string">
  The full HTTPS URL of your Git repository — for example, `https://github.com/user/my-app`. The egg clones this repository into the container on first start.

  Leave this empty if you prefer to upload your project files manually using the panel's **File Manager**. When left empty, the egg skips cloning entirely and expects a `package.json` to already be present in the container.
</ParamField>

<ParamField body="GIT_BRANCH" type="string" default="main">
  The branch to clone and run. Set this to any valid branch name, such as `main`, `master`, or `production`.

  Leave it empty to use the repository's default branch as configured on the remote.
</ParamField>

<ParamField body="AUTO_UPDATE" type="boolean" default="1">
  Controls whether the egg pulls the latest commits from your repository every time the server starts.

  * `1` — runs `git reset --hard` followed by `git pull` on each startup, ensuring your container always runs the newest code.
  * `0` — skips the pull. Use this when you want to pin the server to a specific commit or manage deployments manually.

  <Note>
    Even with `AUTO_UPDATE` set to `1`, dependencies are reinstalled and (in production mode) the app is rebuilt on every start. Keep this in mind for servers where startup time matters.
  </Note>
</ParamField>

## Private Repository Authentication

<ParamField body="USERNAME" type="string">
  Your GitHub or GitLab username. Only required when connecting to a private repository.

  Leave empty for public repositories — the egg will clone without authentication.
</ParamField>

<ParamField body="ACCESS_TOKEN" type="string">
  A personal access token with at least the `repo` scope. Only required for private repositories.

  Generate one at [GitHub Settings → Tokens](https://github.com/settings/tokens). Set `GIT_URL` to the plain HTTPS URL **without** any credentials embedded — the egg injects your username and token automatically.

  <Warning>
    Treat your access token like a password. Do not commit it to your repository or share it publicly.
  </Warning>
</ParamField>

## Runtime

<ParamField body="NODE_RUN_ENV" type="string" required default="production">
  Determines how Next.js starts. Accepted values are `production` and `development`.

  * `production` — runs `next build` to produce an optimized build, then starts the server with `next start`. Use this for live, publicly facing sites.
  * `development` — skips the build step and starts with `next dev`, enabling hot-reload. Use this when actively developing your application.

  <Note>
    In `development` mode, the build step is skipped entirely. Your changes are reflected immediately without restarting the server.
  </Note>
</ParamField>

<ParamField body="PACKAGE_MANAGER" type="string" required default="auto">
  The package manager used to install your Node.js dependencies. Accepted values are `auto`, `npm`, `pnpm`, and `yarn`.

  * `auto` — the egg inspects your repository for a lockfile and selects the appropriate manager: `pnpm-lock.yaml` → pnpm, `yarn.lock` → yarn, otherwise npm.
  * `npm`, `pnpm`, or `yarn` — forces a specific manager regardless of which lockfiles are present.

  See [Package Managers](/configuration/package-managers) for full details on install behavior.
</ParamField>

## Cloudflare Tunnel

<ParamField body="CLOUDFLARE_TOKEN" type="string">
  A Cloudflare Tunnel token from your [Zero Trust dashboard](https://one.dash.cloudflare.com/) under **Networks → Tunnels → Configure → Run token**.

  When set, the egg installs `cloudflared` and starts the tunnel in the background before launching Next.js. Leave empty to disable tunnel support entirely.

  <Tip>
    Cloudflare Tunnel lets you expose your Next.js app to the internet without opening firewall ports or configuring a reverse proxy.
  </Tip>
</ParamField>

***

## Variable Reference

| Name                    | Env Key            | Default      | Required |
| ----------------------- | ------------------ | ------------ | -------- |
| Git Repository URL      | `GIT_URL`          | *(empty)*    | No       |
| Git Branch              | `GIT_BRANCH`       | `main`       | No       |
| Auto Update             | `AUTO_UPDATE`      | `1`          | Yes      |
| Git Username            | `USERNAME`         | *(empty)*    | No       |
| Git Access Token        | `ACCESS_TOKEN`     | *(empty)*    | No       |
| Run Environment         | `NODE_RUN_ENV`     | `production` | Yes      |
| Package Manager         | `PACKAGE_MANAGER`  | `auto`       | Yes      |
| Cloudflare Tunnel Token | `CLOUDFLARE_TOKEN` | *(empty)*    | No       |
