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

# Environment reference

> Every environment variable the app reads, grouped by concern.

`.env.example` is the source of truth. This page groups those variables by what they unlock,
so you can fill in only the blocks you need.

## Core Laravel

Standard framework keys: `APP_NAME`, `APP_ENV`, `APP_KEY`, `APP_DEBUG`, `APP_URL`,
`APP_LOCALE`, `LOG_*`, `DB_*`, `SESSION_*`, `CACHE_STORE`, `QUEUE_CONNECTION`, `MAIL_*`,
`REDIS_*` and `AWS_*`.

Defaults worth knowing:

| Variable           | Default    | Note                                             |
| ------------------ | ---------- | ------------------------------------------------ |
| `DB_CONNECTION`    | `sqlite`   | Zero-setup local development                     |
| `SESSION_DRIVER`   | `database` | Migrations required before first request         |
| `CACHE_STORE`      | `database` | Also backs the scheduler's `onOneServer()` locks |
| `QUEUE_CONNECTION` | `database` | A worker must be running for any provider work   |
| `MAIL_MAILER`      | `log`      | Mail is written to the log locally, not sent     |

## Authentication — Clerk

Clerk handles authentication. Without these, dashboard routes are unreachable.

```ini theme={null}
CLERK_PUBLISHABLE_KEY=
VITE_CLERK_PUBLISHABLE_KEY=   # same value; exposed to the browser via Vite
CLERK_SECRET_KEY=
CLERK_FRONTEND_API_URL=
CLERK_JWKS_URL=
CLERK_PERMITTED_ORIGINS=      # comma-separated azp allow-list, e.g. https://app.example.com
CLERK_WEBHOOK_SIGNING_SECRET=
```

<Warning>
  `VITE_CLERK_PUBLISHABLE_KEY` is compiled into the frontend bundle. Only the publishable key
  belongs there — never give a `VITE_` prefix to a secret.
</Warning>

## AI providers

```ini theme={null}
OPENAI_API_KEY=
OPENAI_ORGANIZATION_ID=
GOOGLE_AI_API_KEY=            # Gemini
ANTHROPIC_API_KEY=            # Claude
PERPLEXITY_API_KEY=
GROK_API_KEY=                 # xAI
SERPAPI_API_KEY=              # Google AI Overview + AI Mode
```

Model selection and defaults are covered on [AI providers](/configuration/ai-providers).

## Prompt behaviour

| Variable                          | Default | Effect                                      |
| --------------------------------- | ------- | ------------------------------------------- |
| `PROMPTS_ACTIVE_LIMIT`            | `10`    | Maximum active prompts per campaign         |
| `PROMPTS_AUTO_SEED`               | `true`  | Seed a starter prompt set for new campaigns |
| `AI_BATCH_ENABLED`                | `true`  | Batched provider submission                 |
| `AI_BATCH_MAX_REQUESTS_PER_BATCH` | `1000`  | Requests per batch                          |
| `AI_BATCH_TIMEOUT_HOURS`          | `24`    | Batch abandonment threshold                 |

## Scoring weights

Not present in `.env.example`, but read by `config/scoring.php` — override only when
deliberately retuning the score:

| Variable                         | Default |
| -------------------------------- | ------- |
| `SCORING_OPENAI_WEIGHT`          | `0.30`  |
| `SCORING_PERPLEXITY_WEIGHT`      | `0.25`  |
| `SCORING_GEMINI_WEIGHT`          | `0.20`  |
| `SCORING_GROK_WEIGHT`            | `0.10`  |
| `SCORING_AI_OVERVIEW_WEIGHT`     | `0.10`  |
| `SCORING_AI_MODE_WEIGHT`         | `0.05`  |
| `SCORING_RANK_EXPONENT`          | `1.2`   |
| `SCORING_MIN_NORMALIZATION`      | `20`    |
| `SCORING_NON_COMPETITOR_PENALTY` | `0.5`   |
| `SCORING_DIRECT_COMP_THRESHOLD`  | `0`     |
| `SCORING_CLASSIFY_TOP_N`         | `30`    |

<Warning>
  The six LLM weights must sum to `1.0`. Changing one without compensating elsewhere shifts
  every score in the system, and historical scores are not recalculated automatically.
</Warning>

## Google and Bing

```ini theme={null}
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_ANALYTICS_CLIENT_ID=
GOOGLE_ANALYTICS_CLIENT_SECRET=
```

Bing Webmaster Tools uses OAuth configured through `config/services.php`. See
[integrations](/configuration/integrations).

## Billing

Polar is the active billing provider; Cashier/Stripe keys remain in place.

```ini theme={null}
POLAR_ACCESS_TOKEN=
POLAR_ORGANIZATION_ID=
POLAR_SERVER=sandbox          # "sandbox" for dev/staging, "production" for prod
POLAR_WEBHOOK_SECRET=
POLAR_PRODUCT_STARTER=
POLAR_PRODUCT_GROWTH=
POLAR_PRODUCT_ENTERPRISE=

STRIPE_KEY=
STRIPE_SECRET=
STRIPE_WEBHOOK_SECRET=
CASHIER_CURRENCY=usd
CASHIER_CURRENCY_LOCALE=en_US
```

<Note>
  Polar product IDs differ between sandbox and production. Switching `POLAR_SERVER` without
  swapping the three `POLAR_PRODUCT_*` IDs will fail at checkout.
</Note>

## Other services

```ini theme={null}
SCREENSHOTONE_ACCESS_KEY=     # SERP screenshots on prompt runs
SCREENSHOTONE_SECRET_KEY=

HUBSPOT_PORTAL_ID=            # marketing waitlist form
HUBSPOT_FORM_ID=

MATTERMOST_ACCESS=            # error logging channel
MATTERMOST_CHANNEL_ID=
MATTERMOST_LOG_ENABLED=false

FACEBOOK_CLIENT_ID=           # social OAuth, present but unused by the dashboard
FACEBOOK_CLIENT_SECRET=
LINKEDIN_CLIENT_ID=
LINKEDIN_CLIENT_SECRET=
```
