Self-hosting

Configuration reference

Every setting, what it does, and where it is set.

Locally, the API reads apps/api/.dev.vars. On Cloudflare, anything secret is set with wrangler secret put NAME, and the rest goes in the [vars] block of apps/api/wrangler.toml.

API: required

VariableWhat it is
SESSION_SECRETSigns sessions and sign-in cookies. Generate with openssl rand -hex 32. Changing it signs everyone out.
ENCRYPTION_SECRETEncrypts stored AI provider keys with AES-GCM. A different value from SESSION_SECRET. Changing it makes saved keys unreadable, so each user saves theirs again.
WEB_ORIGINThe web app’s origin, exactly, for example https://jobs.example.com. Sign-ins from anywhere else are refused.
COOKIE_DOMAINlocalhost when running locally. Any other value, such as production, turns on secure cookies that work across your web and API origins over HTTPS.
EXTENSION_IDYour build of the extension’s ID, from chrome://extensions. The API only accepts requests from this extension.

Plus at least one sign-in method below.

API: sign-in

All optional and independent. See sign-in methods.

VariableWhat it is
GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRETA GitHub OAuth app.
GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRETA Google OAuth client of type Web application.
APPLE_CLIENT_IDThe Services ID, not a bundle id.
APPLE_TEAM_ID, APPLE_KEY_IDFrom your Apple Developer account.
APPLE_PRIVATE_KEYThe whole contents of the .p8 file.
RESEND_API_KEY, EMAIL_FROMEmailed sign-in links through Resend. Both are needed.
BETTER_AUTH_SECRETOptional separate signing secret for sign-in. Falls back to SESSION_SECRET.
API_ORIGINOnly when something in front of the Worker rewrites the Host header. Normally the origin is taken from the request.

API: optional services

VariableWhat it is
CF_ACCESS_CLIENT_ID, CF_ACCESS_CLIENT_SECRETA Cloudflare Access service token, sent with requests to an Ollama server you have put behind Access.
LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEYTracing of model calls in Langfuse. Unset, tracing is skipped.
LANGFUSE_BASE_URLYour Langfuse host, by default https://cloud.langfuse.com.
LANGFUSE_TRACING_ENVIRONMENTKeeps one deployment’s traces apart from another’s in the same project.
STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET, STRIPE_PRICE_IDBilling. Unset, billing answers that it is not configured and everything else works, which is the ordinary self-hosted case.

API: bindings

Set in apps/api/wrangler.toml.

BindingWhat it is
DBThe D1 database. Migrations come from packages/db/migrations.
CV_FILESThe R2 bucket that keeps imported CV files.

Web app

VariableWhereWhat it is
PUBLIC_API_URLapps/web/.env, or the Pages projectThe API’s URL.
PUBLIC_SITE_URLThe build environment onlyThe public origin, used for the canonical link and social cards. Left unset, those tags are omitted.

PUBLIC_SITE_URL has to be in the environment of the build itself, for example PUBLIC_SITE_URL=https://jobs.example.com pnpm --filter @jlog/web build, or a Pages project variable. Putting it in apps/web/.env does not work, because the site’s config is read before that file is loaded.

Extension

In apps/extension/.env, read when the extension is built:

VariableWhat it is
VITE_API_BASEThe API’s URL. Defaults to http://localhost:8787.
VITE_WEB_BASEThe web app’s URL, for links from the popup. Defaults to http://localhost:4321.

The API’s origin also has to be listed in host_permissions in apps/extension/manifest.config.ts.

Edit this page on GitHub