# Reference env block — copy into .env.example (placeholders) and .env.local (real values). # (.env.example is permission-protected, so this lives here as a copy source.) # # Object storage = Cloudflare R2 (S3-compatible). The same R2_* vars are read by # BOTH the Next app (src/env.ts, @aws-sdk/client-s3) and the analytics service # (services/analytics, DuckDB R2 secret + Bun S3). Endpoint is derived: # https://.r2.cloudflarestorage.com (region "auto") # # Provision once (you, authenticated to Cloudflare): # bunx wrangler r2 bucket create seo-exports # Dashboard → R2 → Manage R2 API Tokens → create token (Object Read & Write, # scoped to the bucket) → copy Access Key ID + Secret Access Key + Account ID. # ── Analytics ETL — heavy keyword CSV imports ── ANALYTICS_URL=http://localhost:8787 R2_ACCOUNT_ID=48dd4828d96b022824b446c97b0bc8da R2_ACCESS_KEY_ID=paste-from-r2-api-token R2_SECRET_ACCESS_KEY=paste-from-r2-api-token R2_BUCKET=seo-exports # ── Staging / Production ── # Same keys, separate R2 buckets per env (e.g. seo-exports-staging / seo-exports-prod) # and the deployed ANALYTICS_URL.