# Thally environment variables (copy to .env.local) # # Legacy DOX_* names still work: every THALLY_* variable falls back to its # old DOX_* equivalent, so existing deployments keep working unchanged. # Public site URL, used for canonical links, OpenGraph, JSON-LD, and agent # manifests. Set it in your host's environment to your production origin. # When unset, Thally uses the URL your host publishes: Vercel # (VERCEL_PROJECT_PRODUCTION_URL, then VERCEL_URL) at build and runtime; # Netlify (URL, then DEPLOY_PRIME_URL) and Cloudflare Pages (CF_PAGES_URL) at # build time only; Render (RENDER_EXTERNAL_URL) at runtime only. Outside # Vercel, set it explicitly for complete coverage, and always for custom # domains or Cloudflare Workers (dashboard, or "vars" in wrangler.jsonc). # llms.txt and robots.txt use the origin of each request either way. # A localhost value never overrides a host-published URL. Leave it unset locally. # The legacy DOX_SITE_URL and NEXT_PUBLIC_SITE_URL names are still honored. # THALLY_SITE_URL=https://docs.example.com # Thally Cloud (optional). Paste the one-time site credential from Thally Cloud into # your hosting provider as a SERVER-SIDE secret, then redeploy. Never prefix it # with NEXT_PUBLIC_. The runtime exchanges it for short-lived grants and phones # home automatically when the deployed docs site is visited. # THALLY_CLOUD_SITE_TOKEN=thally_site_... # THALLY_CLOUD_URL=https://app.thally.io # THALLY_CLOUD_SITE_CONFIG= # Managed hosting injects this release snapshot automatically. # Content source (optional, default "filesystem"). Managed hosting sets # "assets" — at build AND runtime — so content is read from the deployment's # static assets and a content-only publish goes live without a rebuild. # Self-hosted sites should leave this unset. # THALLY_CONTENT_SOURCE=filesystem # Managed hosting also injects the compact release-owned docs.json snapshot. # Self-hosted sites should leave this unset and keep authoring docs.json. # THALLY_DOCS_CONFIG= # Optional: opt out of Turbopack's persistent build cache (kept under # .next/cache; speeds up warm builds). Set only if a production build # misbehaves with the cache enabled. # THALLY_DISABLE_BUILD_CACHE=1 # Admin dashboard — set to enable /admin analytics THALLY_ADMIN_PASSWORD=change-me # Required in production when password admin access is enabled. Generate a # high-entropy value; human passwords are never used as session signing keys. # THALLY_ADMIN_SECRET= # Optional: password-protect the entire docs site # THALLY_ACCESS_PASSWORD= # Required in production with THALLY_ACCESS_PASSWORD. May fall back to the # high-entropy THALLY_ADMIN_SECRET, but a separate value is preferred. # THALLY_ACCESS_SECRET= # Optional: reader authentication (docs.json `auth.mode` "jwt" or "oidc"). # Gates pages by signed-in reader and `groups`. See /guides/authenticated-docs. # Session-signing secret for reader sessions (32+ random characters). Required # in production; must differ from every admin/access secret. # THALLY_READER_SESSION_SECRET= # Local previews only: sign sessions with a PUBLIC dev key (ignored when # NODE_ENV=production). Anyone who can reach the server can then forge reader # sessions with any groups — never set this on a server others can reach. # THALLY_READER_ALLOW_DEV_SESSION_KEY=1 # JWT handoff: set exactly ONE key source. # THALLY_READER_JWT_SECRET= # HS256 shared secret, 32+ characters # THALLY_READER_JWT_PUBLIC_KEY= # SPKI PEM for RS256/PS256/ES256/EdDSA ("\n" escapes allowed) # THALLY_READER_JWKS_URL= # https JWKS endpoint (or docs.json auth.jwt.jwksUrl) # OIDC with your identity provider (issuer may also live in docs.json): # THALLY_READER_OIDC_ISSUER= # THALLY_READER_OIDC_CLIENT_ID= # THALLY_READER_OIDC_CLIENT_SECRET= # Agent/MCP reader tokens: "kid:secret" pairs (32+ char secrets); the first signs. # Mint with `npm run reader-token -- --label ci --groups beta --days 30`. # THALLY_READER_TOKEN_KEYS= # Optional: internal analytics ingest secret # THALLY_ANALYTICS_SECRET= # Analytics store (durable, serverless-safe). Defaults to an embedded libSQL file # at .data/analytics/events.db — zero config, no external service for local/self-host. # For production on serverless (Vercel/Lambda), point at a Turso/libSQL database so # events survive redeploys and are shared across instances: # THALLY_ANALYTICS_DB_URL=libsql://your-db.turso.io # THALLY_ANALYTICS_DB_TOKEN=your-turso-auth-token # Durable key–value storage (rate-limit counters, docs-task queue, insights, audit). # Defaults to an embedded libSQL file at .data/thally.db — zero config for local/self-host. # For production on serverless, point at a Turso/libSQL database so state survives # redeploys and is shared across instances. Set THALLY_STORAGE=memory to opt out entirely. # THALLY_DATABASE_URL=libsql://your-db.turso.io # THALLY_DATABASE_TOKEN=your-turso-auth-token # THALLY_STORAGE=memory # AI chat widget — answers are served by Thally Cloud. Turn on `ai.chat` in # docs.json and link the site with THALLY_CLOUD_SITE_TOKEN (above); the widget # stays hidden until the linked site is entitled. The open-source runtime has # no self-hosted chat backend and reads no model key for chat. # # ANTHROPIC_API_KEY is read only by local tooling — `thally agent`, # `thally translate`, and non-Markdown conversion in `thally migrate`. # ANTHROPIC_API_KEY= # Public agent endpoints (per client; 0 disables the limit): # THALLY_MCP_RATE_PER_MIN=60 # /api/mcp tool calls + resource reads/min # THALLY_SEARCH_HYBRID_RATE_PER_MIN=20 # /api/search?mode=hybrid queries/min when a hosted # # embedding provider is set; over it, full-text is served # Admin team auth — the session-signing secret (a secret, NOT a database). # Required to enable team accounts + roles; without it, the admin falls back to # the single THALLY_ADMIN_PASSWORD. Use a long random string. # THALLY_AUTH_SECRET=change-me-to-a-long-random-string # Thally Track — merged/preview PRs in tracked repos become docs PRs (see /guides/ai-features). # # Recommended: use the admin dashboard "Connect GitHub" button (Settings → # Integrations) to create + install your own GitHub App — no env vars, org-wide # access to selected repos. That path only needs THALLY_AUTH_SECRET (above) set. # # Dispatch target — the docs repo Track opens PRs against. Defaults to # siteConfig.repoUrl (site.ts). Set this when you keep site.ts as the template # default (repoUrl: '') but still want Track to dispatch to your own repo. # Deployer-set, so it's trusted (unlike the admin-editable repo URL, which the # webhook intentionally ignores). # THALLY_REPO_URL=https://github.com/your-org/your-docs-repo # Manual webhook path (Mode B): HMAC secret shared with the GitHub webhook on # each tracked repo; /api/track/webhook is OFF until this is set (a connected # GitHub App supplies its own secret and doesn't need this). # THALLY_TRACK_WEBHOOK_SECRET= # GitHub token (Mode B): a fine-grained PAT that reads tracked product-repo PRs, # relays the dispatch to the docs repo, and authenticates the admin Docs-tasks # queue. Public repos work without it (rate-limited). # THALLY_GITHUB_TOKEN= # Optional — wire a GitHub App by hand instead of the Connect button. The token # resolver mints an installation token from these (private key is the PEM). # THALLY_GITHUB_APP_ID= # THALLY_GITHUB_APP_INSTALLATION_ID= # THALLY_GITHUB_APP_PRIVATE_KEY= # Optional build-only first-publication observation (managed builds set this from the immutable release). # THALLY_PAGE_UPDATE_OBSERVED_AT=2026-11-27T00:00:00Z # Legacy fallback: DOX_PAGE_UPDATE_OBSERVED_AT