Skip to content

Configuration

Cursor Agent edited this page Dec 1, 2026 · 1 revision

Configuration

🇫🇷 Version française

All configuration is done through environment variables. Copy .env.example to .env.local for development, or set them in your hosting platform. Never commit real values.

NEXT_PUBLIC_* variables are embedded in the browser bundle at build time. Set them before npm run build.

Required

Variable Description
NEXT_PUBLIC_SUPABASE_URL Supabase project URL (https://<project>.supabase.co).
NEXT_PUBLIC_SUPABASE_ANON_KEY Supabase public anon key (safe for the browser, protected by row-level security).
ANTHROPIC_API_KEY Anthropic API key used for outlines, drafts, rewrites and analyses. Server only.
ANTHROPIC_MODEL Claude model used for outlines and drafting. See .env.example for the default.
ENCRYPTION_KEY 32 random bytes in base64 (openssl rand -base64 32). Encrypts CMS credentials before they are stored. Losing it makes stored connections unreadable.
NEXT_PUBLIC_SITE_URL Public URL of the app (used in sign-in e-mails and redirects). http://localhost:3000 in development.

Optional features

Variable Feature Notes
GOOGLE_AI_API_KEY, GOOGLE_IMAGE_MODEL Cover and inline images Without the key, image generation fails with an error; the rest works.
GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET Google Search Console opportunities OAuth client; add <site>/api/gsc/callback as an authorised redirect URI.
SMTP_USER, SMTP_PASSWORD, SMTP_HOST, SMTP_PORT, SMTP_FROM Team invitation e-mails Defaults to Gmail/Google Workspace SMTP with an app password; any SMTP server works.
STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET, STRIPE_PRICE_ESSENTIEL, STRIPE_PRICE_COMPLET Subscriptions Create two recurring monthly prices in Stripe and a webhook endpoint <site>/api/stripe/webhook with the events checkout.session.completed, customer.subscription.created, customer.subscription.updated, customer.subscription.deleted.
SUPABASE_SERVICE_ROLE_KEY Stripe webhook (no user session) Server secret. Never expose it in NEXT_PUBLIC_*, never commit it.

Key rotation

To change ENCRYPTION_KEY without losing stored credentials:

  1. Put the new key in ENCRYPTION_KEY and the previous one in ENCRYPTION_KEY_OLD (comma-separated if several).
  2. In your own terminal (never on the deployed app), set SUPABASE_SERVICE_ROLE_KEY and run npm run rotate-key.
  3. Remove ENCRYPTION_KEY_OLD and SUPABASE_SERVICE_ROLE_KEY from that environment.

Security notes

  • Keep service keys server-side only. If a key leaks (even in a commit that was later removed), revoke it: deleting it from the code is not enough.
  • Outgoing requests to user-provided addresses (CMS sites, pages to read) go through a guard that blocks internal network ranges.
  • The repository uses GitHub secret scanning with push protection, and CI runs gitleaks on every pull request.

Clone this wiki locally