Skip to content

Open-source agentic AI Search Execution Platform. Track AI visibility, find opportunities, and let agents turn signals into prioritized actions and drafted fixes across ChatGPT, Claude, Gemini, Google AI Overviews, Google AI Mode, Perplexity, Grok, and Microsoft Copilot.

6.0 KB
Raw Blame
---
title: "Environment variables"
description: "Full reference for every env var across web and server."
---

## Web (`web/.env`)

Fed to the Next.js app. Variables prefixed with `NEXT_PUBLIC_` are exposed to the browser.

| Variable | Required | Description |
|---|---|---|
| `NEXT_PUBLIC_SUPABASE_URL` | ✅ | Your Supabase project URL |
| `NEXT_PUBLIC_SUPABASE_ANON_KEY` | ✅ | Supabase anon key (public, RLS-protected) |
| `SUPABASE_SERVICE_ROLE_KEY` | ✅ | Service role key (bypasses RLS — used for server actions; never expose) |
| `NEXT_PUBLIC_API_URL` | ✅ | Server URL (e.g. `https://api.your-domain.com` or `http://localhost`) |
| `NEXT_PUBLIC_APP_URL` | ✅ | Web app URL (used for OAuth callback URLs) |
| `OPENAI_API_KEY` | optional* | OpenAI API key |
| `GOOGLE_GEMINI_API_KEY` | optional* | Google AI Studio Gemini key |
| `ANTHROPIC_API_KEY` | optional* | Anthropic Claude key |
| `PERPLEXITY_API_KEY` | optional* | Perplexity API key |
| `GROK_API_KEY` | optional* | xAI Grok key |
| `NEXT_PUBLIC_IS_CLOUD` | optional | `"true"` for the official cloud build (enables billing UI). Leave unset for self-hosted (all features unlocked). |
| `STRIPE_SECRET_KEY` | cloud only | Stripe live/test secret key |
| `STRIPE_WEBHOOK_SECRET` | cloud only | Stripe webhook signing secret |
| `CRON_SECRET` | cloud only | Shared secret for Vercel cron → server auth |

\* You need **at least one AI provider key** for tracking to work. Configure providers per-brand in the dashboard.

## Server (`server/.env`)

Fed to the Express API + workers.

| Variable | Required | Description |
|---|---|---|
| `NODE_ENV` | ✅ | `production` for live, `development` for local |
| `PORT` | ✅ | Default `80` |
| `SUPABASE_URL` | ✅ | Same as web's `NEXT_PUBLIC_SUPABASE_URL` |
| `SUPABASE_ANON_KEY` | ✅ | Supabase anon key |
| `SUPABASE_SERVICE_ROLE_KEY` | ✅ | Service role key (used by workers and admin endpoints) |
| `OPENAI_API_KEY` | optional* | OpenAI key |
| `ANTHROPIC_API_KEY` | optional* | Anthropic key |
| `GOOGLE_GENERATIVE_AI_API_KEY` | optional* | Google Gemini key (server-side name differs from web) |
| `DEFAULT_SUGGESTION_MODEL` | optional | Default LLM for AI suggestions (default: `google/gemini-3-flash-preview`) |
| `TOPIC_SUGGESTION_MODEL` | optional | LLM for topic suggestions |
| `PROMPT_SUGGESTION_MODEL` | optional | LLM for prompt suggestions |
| `COMPETITOR_SUGGESTION_MODEL` | optional | LLM for competitor suggestions |
| `CONTENT_READ_MODEL` | optional | LLM the Content Editor reads and judges with: the brief (**Rebuild outline**) and Quality's checks. Default: `anthropic/claude-haiku-5-5` when `ANTHROPIC_API_KEY` is set, else `IMPROVE_SUGGESTION_MODEL`, then `DEFAULT_SUGGESTION_MODEL`, then `google/gemini-3-flash-preview`. `QUALITY_CHECK_MODEL`, when set, still picks Quality's model. |
| `CONTENT_WRITE_MODEL` | optional | LLM the Content Agent writes with: pages written or rewritten whole and its suggestions. Default: `anthropic/claude-sonnet-5-5` when `ANTHROPIC_API_KEY` is set, else the same fallbacks as `CONTENT_READ_MODEL`. A Claude model must support structured outputs (Claude 4.5 models or newer). |
| `AUDIT_LLM_MODEL` | optional | LLM for the Site Audit's LLM-judged signals + AI recommendations (default: `google/gemini-3-flash-preview`) |
| `ALLOWED_ORIGINS` | ✅ | Comma-separated list of web origins allowed to call the API (for CORS) |
| `IS_CLOUD` | optional | `"true"` only for the official cloud build |
| `DATAFORSEO_LOGIN` | optional | DataForSEO login (for prompt volume analysis) |
| `DATAFORSEO_PASSWORD` | optional | DataForSEO password |
| `DEMAND_SIGNALS` | optional | `"true"` to read each tracked prompt's Google Trends, People Also Ask and YouTube demand from DataForSEO about once a week (the Demand card on a prompt's page). **Costs money:** each read is a paid DataForSEO task, about $0.004 a prompt a week, at most 500 prompts a night. Off by default; needs the DataForSEO keys above. Search Console demand is read every night either way, at no cost. |
| `CLORO_API_KEY` | optional | Cloro web scraper API key (for ChatGPT/Gemini/Perplexity web scraping) |
| `CLORO_CHATGPT_FANOUT` | optional | ChatGPT's query fan-out: `sample` asks for each prompt's searches one day a week, `all` on every nightly run, `off` never. Default `off` on self-host (an unknown value is `off` too, with a warning in the log). It goes through Cloro's legacy ChatGPT interface, which Cloro calls best-effort and temporary. Only the nightly run's first attempt asks; manual runs and retries don't. **Costs credits:** +2 for each ChatGPT task that asks, and a prompt has one task per location, so `sample` adds 2 credits a week for each prompt and location. The day is the UTC day the nightly run starts: with `DAILY_CRON_SCHEDULE` close to midnight UTC, a prompt can be asked 0 or 2 times in a week |
| `PLATFORM_PROVIDER` | optional | Default `cloro`. Used to pick scraper backend |
| `SCRAPEDO_API_KEY` | Site Audit | Scrape.do API key — required to run **Site Audit** (it fetches target pages via Scrape.do's proxy + JS render). Distinct from `CLORO_API_KEY`, which scrapes the AI answer engines. |
| `AI_VOLUME_MULTIPLIER` | optional | Estimated AI search adoption rate (default `0.45` = 45% of a prompt's Google volume, the median of its keywords' monthly searches; AI Overviews appear on roughly 43–48% of Google searches) |
| `CRON_SECRET` | cloud only | Shared secret with web's CRON_SECRET; protects internal cron endpoints |

## Tips for production

- **Mark secrets as sensitive** — on Vercel, toggle the *Sensitive* flag on every secret env var. Once set, the value is write-only and can't be read back from the UI.
- **Rotate `SUPABASE_SERVICE_ROLE_KEY` and `CRON_SECRET`** quarterly as a hygiene practice
- **Use a different Supabase project for each environment** (dev / staging / prod). Don't share databases across environments — RLS bypasses make it easy to corrupt prod data with a misconfigured dev pointer

<Card title="Continue: Upgrading" icon="arrow-right" href="/self-host/upgrading">
  How to upgrade your self-hosted instance to a new release.
</Card>