Skip to content

Environment Variables

This is a static site, so most variables are optional. See .env.example for the full list.

Copy .env.example to .env for build-time variables:

# Public production URL (canonical/OG/sitemap)
SITE_URL=http://localhost:4321
# Optional analytics
PUBLIC_GA_MEASUREMENT_ID=
PUBLIC_GTM_ID=

Set these at build time. For static output, all PUBLIC_* vars are inlined — rebuild and redeploy if any change.

Terminal window
SITE_URL=https://broca.id pnpm build

Or via .env file:

Terminal window
cp .env.example .env
# edit .env with production values
pnpm build
Variable Purpose
SITE_URL Canonical URL for sitemap, OG tags, RSS
Variable Purpose
GOOGLE_SITE_VERIFICATION Google Search Console verification
BING_SITE_VERIFICATION Bing Webmaster Tools verification
PUBLIC_GA_MEASUREMENT_ID Google Analytics 4 measurement ID
PUBLIC_GTM_ID Google Tag Manager container ID
PUBLIC_CONSENT_ENABLED Enable cookie consent banner
PUBLIC_PRIVACY_POLICY_URL URL to privacy policy page

The validate:secrets script scans the repo for accidentally committed secrets:

Terminal window
pnpm run validate:secrets

It runs during CI and fails the build if a likely secret is detected.