Docs · Operate
Configuration
Every setting, grouped by what it turns on.
Each package that needs secrets has a .env.example documenting its variables: the root one for Docker Compose, plus packages/db, apps/api and apps/web. Settings used to be named HIRELENS_*; those names still work, and the CANDIDLENS_* name wins when both are set. Empty values count as unset.
On Vercel, changed variables reach only new deployments, so redeploy after editing them. Variables that start with NEXT_PUBLIC_ are built into the web app, so they also need a rebuild.
Core
| Variable | Purpose |
|---|---|
DATABASE_ | Postgres connection, e.g. postgres://postgres:postgres@localhost:5433/hirelens |
BETTER_ | Signs sessions. At least 32 random characters (openssl rand -base64 32); production refuses to start without one |
BETTER_ | The app's public address; sign-in callbacks and email links are built from it |
TRUSTED_CORS_ | Comma-separated origins allowed to start sign-in or call the API |
NEXT_ | Canonical address for the sitemap, robots and link previews |
NEXT_ | Leave empty when the API runs inside the web app (Vercel); set it for a separate API service |
PORT | API port when it runs on its own (default 4000) |
Sign-in
| Variable | Purpose |
|---|---|
GOOGLE_GOOGLE_ | Google sign-in. Redirect URL: <origin>/api/auth/callback/google |
GITHUB_GITHUB_ | GitHub sign-in. Redirect URL: <origin>/api/auth/callback/github |
NEXT_NEXT_ | Show the matching button. Set to true only when the server keys above exist |
Email powers password reset, email confirmation and changing an email. See Accounts & sign-in.
| Variable | Purpose |
|---|---|
CANDIDLENS_CANDIDLENS_ | SMTP sign-in. The defaults fit a Gmail account with 2-Step Verification and an app password; use a dedicated account, not a personal one |
CANDIDLENS_CANDIDLENS_ | Another provider. Port 465 starts with TLS; any other port must upgrade to TLS before the password is sent |
CANDIDLENS_ | The sender, e.g. "CandidLens" <you@example.com> |
NEXT_ | Only with a separate API service: whether the web app offers the email features. On Vercel it is worked out from the SMTP settings |
Without the SMTP settings, a development server prints each email (with its link) to its log, and a production server hides the email features. Gmail sends about 500 emails a day; mail from a new Gmail account may land in spam at first.
Models
| Variable | Purpose |
|---|---|
CANDIDLENS_CANDIDLENS_ | Turns on scoring: google, anthropic, groq, openrouter, mistral, cerebras or ollama |
CANDIDLENS_CANDIDLENS_ | The provider's key, and its address for Ollama or a compatible gateway |
CANDIDLENS_ | Failover chain, e.g. groq,openrouter, tried only when the primary is overloaded or rate-limited. Each fallback needs CANDIDLENS_LLM_<ID>_MODEL (plus _API_KEY, _BASE_URL); a fallback never borrows the primary's model id |
CANDIDLENS_ | Overall retry and failover budget (default 120000 ms, at most 600000) so a request can't outlive a serverless limit |
CANDIDLENS_ | A Google AI key for search by meaning; resume text goes to Google's embedding model, gemini-embedding-2. Without it, the model key is used when the provider is google, then CANDIDLENS_LLM_GOOGLE_API_KEY. Another provider's key is never sent to Google; with no Google key, search matches keywords |
Without a model, the model-backed features (scoring, rubric drafting and Ask) are off and the rest of the app works; the public demo falls back to a deterministic heuristic.
Observability
All optional, and off until set. Nothing phones home by default.
| Variable | Purpose |
|---|---|
SENTRY_ | Error tracking |
LANGFUSE_LANGFUSE_LANGFUSE_ | Model tracing |
NEXT_NEXT_ | Product analytics: explicit events only, autocapture off |
Checking a deployment
GET /api/health answers quickly without touching the database. GET /api/health?db=1 also compares the applied migrations with the code, and answers 503 with "migrationsPending": true and a message naming the command to run when the schema is behind.