Environment Variables
Complete list of environment variables for DirectoryKit.
Required variables
| Variable | Description |
|---|---|
NEXT_PUBLIC_APP_URL | Your production URL (e.g., https://mydirectory.com) |
NEXT_PUBLIC_SUPABASE_URL | Supabase project URL |
NEXT_PUBLIC_SUPABASE_ANON_KEY | Supabase anonymous key |
SUPABASE_SERVICE_ROLE_KEY | Supabase service role key (server-only) |
S3_ENDPOINT | S3-compatible storage endpoint |
S3_REGION | Storage region |
S3_BUCKET_NAME | Storage bucket name |
S3_ACCESS_KEY_ID | Storage access key |
S3_SECRET_ACCESS_KEY | Storage secret key |
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY | Stripe publishable key |
STRIPE_SECRET_KEY | Stripe secret key |
STRIPE_WEBHOOK_SECRET | Stripe webhook signing secret |
RESEND_API_KEY | Resend email API key |
CRON_SECRET | Secret for cron job authorization |
Optional variables
| Variable | Description |
|---|---|
NEXT_PUBLIC_GA_MEASUREMENT_ID | Google Analytics 4 ID |
NEXT_PUBLIC_POSTHOG_KEY | PostHog project API key |
NEXT_PUBLIC_POSTHOG_HOST | PostHog instance URL |
SEOBOT_API_KEY | SEObot API key for blog |
DISCORD_WEBHOOK_URL | Discord webhook for notifications |
SUPABASE_PROJECT_ID | For regenerating types |
STRIPE_PRICE_ID_PROMO_BANNER | Stripe price ID for banner promotions |
STRIPE_PRICE_ID_PROMO_CATALOG | Stripe price ID for catalog promotions |
STRIPE_PRICE_ID_PROMO_DETAIL | Stripe price ID for detail page promotions |
NEXT_PUBLIC_LISTINGBOTT_URL | ListingBott integration URL |
NEXT_PUBLIC_LOGO_DEV_TOKEN | Logo.dev API token |
AI_PROVIDER | AI provider (openai or anthropic) |
AI_MODEL | AI model name |
AI_API_KEY | AI provider API key |
ANALYZE | Set 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.