AgentFlow Enterprise Docs

Environment Variables Reference

A deployment reference for public variables, server-only secrets, current Stripe price variable names, and optional readiness variables.

Exposure Rules

Never expose server-only secrets

Variables without the NEXT_PUBLIC_ prefix must remain server-side. SUPABASE_SERVICE_ROLE_KEY, Stripe secrets, OpenAI keys, provider tokens, webhook secrets, SMTP passwords, and API key hashes must never be imported into client components or sent to browsers.

Use placeholders in docs, support tickets, screenshots, and examples. Do not paste real environment variable values into repository files, public docs, chat tools, issue trackers, analytics events, or logs.

Public Browser-Safe Variables

VariableExposurePurposeUsed by
NEXT_PUBLIC_APP_URLBrowser-safeCanonical application URL used by site URL helpers and redirects. NEXT_PUBLIC_SITE_URL is also present as a supported site URL fallback.Client and server
NEXT_PUBLIC_SUPABASE_URLBrowser-safeSupabase project URL used by browser, server, auth callback, proxy, and service-role clients.Client and server
NEXT_PUBLIC_SUPABASE_ANON_KEYBrowser-safeSupabase anon key used by browser and server auth clients. Access is constrained by RLS policies.Client and server
NEXT_PUBLIC_AMPLITUDE_API_KEYBrowser-safeOptional Amplitude analytics key used by components/AmplitudeAnalytics.tsx and server-side event tracking helpers.Client and server
NEXT_PUBLIC_STATUS_PAGE_URLBrowser-safeOptional public status page URL displayed by /status when configured.Client
NEXT_PUBLIC_SENTRY_DSNBrowser-safe if usedOptional browser Sentry DSN. The project also accepts server-only SENTRY_DSN for server/error monitoring.Client and server

Server-Only Variables

VariableScopePurpose
SUPABASE_SERVICE_ROLE_KEYRequired for admin routesCreates the Supabase service-role client in lib/supabase-admin.ts. It bypasses RLS and must never appear in client bundles.
STRIPE_SECRET_KEYRequired for checkout and portalInitializes Stripe in lib/stripe/server.ts for Checkout, Billing Portal, and webhook subscription lookups.
STRIPE_WEBHOOK_SECRETRequired for webhooksUsed by app/api/webhooks/stripe/route.ts to verify the raw request body with Stripe's signature.
STRIPE_SOLO_PRICE_ID / STRIPE_PRICE_SOLORequired for Solo checkoutCurrent code prefers STRIPE_SOLO_PRICE_ID; STRIPE_PRICE_SOLO is a legacy alias supported by lib/stripe/plans.ts.
STRIPE_GROWTH_PRICE_ID / STRIPE_PRICE_GROWTHRequired for Growth checkoutCurrent code prefers STRIPE_GROWTH_PRICE_ID; STRIPE_PRICE_GROWTH is a legacy alias.
STRIPE_ENTERPRISE_PRICE_ID / STRIPE_PRICE_ENTERPRISERequired for Enterprise checkoutCurrent code prefers STRIPE_ENTERPRISE_PRICE_ID; STRIPE_PRICE_ENTERPRISE is a legacy alias.
STRIPE_PRICE_INTERNAL_TESTNot implemented in current codeRequested by the audit as an optional hidden test plan. It was not found in code or .env.example; treat as planned/readiness-only until implemented.
OPENAI_API_KEYRequired for AI qualificationUsed only server-side by /api/ai/qualify-lead and /api/chat to call OpenAI.
OPENAI_MODELOptionalOptional server-side model override. The qualification route defaults to gpt-4o-mini when unset.
HUBSPOT_ACCESS_TOKENOptionalPrivate app token for contact create/update and HubSpot sync paths. HUBSPOT_PRIVATE_APP_TOKEN is also accepted by integration helpers.
HUBSPOT_WEBHOOK_SECRETOptionalCustom HubSpot webhook shared secret checked by app/api/webhooks/hubspot/route.ts when configured.
HUBSPOT_CLIENT_SECRETOptionalUsed for HubSpot v3 signature verification when configured.
SLACK_WEBHOOK_URLOptionalSlack incoming webhook used by lib/integrations/dispatch.ts. Several Slack alias variables are also detected for readiness.
GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRETReadiness pathDetected by lib/integrations/env.ts for Google Calendar and Sheets readiness. No customer-facing Google workflow should be claimed as fully live without UI validation.
GOOGLE_CALENDAR_ID / GOOGLE_SHEETS_IDReadiness pathOptional target IDs detected for Google Calendar and Sheets readiness and passive integration event recording.
SENTRY_DSNOptionalServer-side Sentry DSN used by monitoring helpers and Next/Sentry configuration. Use with PII filtering expectations.
AWS_SES_SMTP_HOST, AWS_SES_SMTP_PORT, AWS_SES_SMTP_USER, AWS_SES_SMTP_PASSWORD, AWS_SES_FROM_EMAILOptionalSMTP settings used by lib/email/ses.ts for payment confirmation and payment failure emails.
UPSTASH_REDIS_REST_URL, UPSTASH_REDIS_REST_TOKENRecommended for production rate limitsUsed by lib/rate-limit.ts. Without them, the code falls back to per-instance in-memory limits.
Placeholder-only examplebash
NEXT_PUBLIC_APP_URL=https://example.agentflow.local
NEXT_PUBLIC_SUPABASE_URL=https://project-ref.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=public-anon-placeholder
SUPABASE_SERVICE_ROLE_KEY=server-only-placeholder
STRIPE_SECRET_KEY=stripe-secret-placeholder
STRIPE_WEBHOOK_SECRET=stripe-webhook-secret-placeholder
STRIPE_SOLO_PRICE_ID=price_placeholder_solo
OPENAI_API_KEY=sk-placeholder
HUBSPOT_ACCESS_TOKEN=pat-placeholder
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/placeholder
AWS_SES_SMTP_PASSWORD=smtp-password-placeholder

Current Gaps and Aliases

  • STRIPE_PRICE_INTERNAL_TEST is not implemented in the inspected codebase. Treat it as a planned or internal-readiness variable until code and UI support exist.
  • STRIPE_PRICE_SOLO, STRIPE_PRICE_GROWTH, and STRIPE_PRICE_ENTERPRISE are legacy aliases. Current code prefers STRIPE_SOLO_PRICE_ID, STRIPE_GROWTH_PRICE_ID, and STRIPE_ENTERPRISE_PRICE_ID.
  • Google Calendar and Google Sheets env names are readiness-configured in lib/integrations/env.ts; they should not be sold as fully live workflows unless the UI and end-to-end delivery are verified.
  • Slack supports multiple alias variables, but the primary documented variable is SLACK_WEBHOOK_URL.
These docs describe implementation readiness and configuration. They are not a SOC 2, ISO 27001, penetration test, or contractual SLA claim.