Environment Variables

Complete list of environment variables for DirectoryKit.

Required variables

VariableDescription
NEXT_PUBLIC_APP_URLYour production URL (e.g., https://mydirectory.com)
NEXT_PUBLIC_SUPABASE_URLSupabase project URL
NEXT_PUBLIC_SUPABASE_ANON_KEYSupabase anonymous key
SUPABASE_SERVICE_ROLE_KEYSupabase service role key (server-only)
S3_ENDPOINTS3-compatible storage endpoint
S3_REGIONStorage region
S3_BUCKET_NAMEStorage bucket name
S3_ACCESS_KEY_IDStorage access key
S3_SECRET_ACCESS_KEYStorage secret key
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEYStripe publishable key
STRIPE_SECRET_KEYStripe secret key
STRIPE_WEBHOOK_SECRETStripe webhook signing secret
RESEND_API_KEYResend email API key
CRON_SECRETSecret for cron job authorization

Optional variables

VariableDescription
NEXT_PUBLIC_GA_MEASUREMENT_IDGoogle Analytics 4 ID
NEXT_PUBLIC_POSTHOG_KEYPostHog project API key
NEXT_PUBLIC_POSTHOG_HOSTPostHog instance URL
SEOBOT_API_KEYSEObot API key for blog
DISCORD_WEBHOOK_URLDiscord webhook for notifications
SUPABASE_PROJECT_IDFor regenerating types
STRIPE_PRICE_ID_PROMO_BANNERStripe price ID for banner promotions
STRIPE_PRICE_ID_PROMO_CATALOGStripe price ID for catalog promotions
STRIPE_PRICE_ID_PROMO_DETAILStripe price ID for detail page promotions
NEXT_PUBLIC_LISTINGBOTT_URLListingBott integration URL
NEXT_PUBLIC_LOGO_DEV_TOKENLogo.dev API token
AI_PROVIDERAI provider (openai or anthropic)
AI_MODELAI model name
AI_API_KEYAI provider API key
ANALYZESet to true for bundle analysis

Security

Variables without the NEXT_PUBLIC_ prefix are server-only and never exposed to the browser. Keep SUPABASE_SERVICE_ROLE_KEY, STRIPE_SECRET_KEY, and RESEND_API_KEY server-only.