Menu

Environment Variables

Good to know

Since Nexty provides multiple repositories, environment variables differ between repositories. Please visit the corresponding environment variable documentation:

Website Basic Configuration

Environment VariableRequiredIntroduced InDescription
NEXT_PUBLIC_SITE_URLRequired1.xWebsite access URL
• For local development, use the startup address, default is http://localhost:3000
• For production environment, use your actual domain
NEXT_PUBLIC_PRICING_PATHRequired2.xCorresponds to the actual pricing plan page, default is /#pricing
NEXT_PUBLIC_LOCALE_DETECTIONRequired1.xLanguage detection mode, recommended to set as false
• Set to true: Enables next-intl automatic detection, will automatically redirect to corresponding language page based on browser language
• Set to false: Uses Nexty.dev's built-in SEO-friendly language detector
NEXT_PUBLIC_OPTIMIZED_IMAGESOptional2.xWhether to enable image optimization, recommended to set as true, which can save Vercel image optimization resources
NEXT_PUBLIC_LOGIN_MODEOptional2.xSelect login mode: page opens login page /login, dialog opens login modal
NEXT_PUBLIC_COOKIE_CONSENT_ENABLEDOptional3.1.6Whether to enable Cookie consent modal

Good to know

Nexty.dev's language detector checks the browser language on the user's first visit. If it doesn't match the current page language, a friendly switch prompt will appear. This approach reduces unnecessary redirects and is more SEO-friendly.

Database

See Database Integration steps.

Environment VariableRequiredIntroduced InDescription
DATABASE_URLRequired3.0.0

Authorization

See Authorization Integration steps.

Environment VariableRequiredIntroduced InDescription
BETTER_AUTH_SECRETOptional3.0.0Generate using command openssl rand -base64 32
NEXT_PUBLIC_GITHUB_CLIENT_IDOptional3.0.0
GITHUB_CLIENT_SECRETOptional3.0.0
NEXT_PUBLIC_GOOGLE_CLIENT_IDOptional3.0.0
GOOGLE_CLIENT_SECRETOptional3.0.0

Cloudflare Turnstile

See Turnstile Integration steps.

Environment VariableRequiredIntroduced InDescription
NEXT_PUBLIC_TURNSTILE_SITE_KEYOptional2.xCloudflare Turnstile will be enabled when filled
TURNSTILE_SECRET_KEYOptional3.0.0

Resend Email Service

See Resend Integration steps.

Environment VariableRequiredIntroduced InDescription
RESEND_API_KEYOptional1.xResend API access key
RESEND_AUDIENCE_IDOptional1.xResend audience ID
ADMIN_EMAILOptional1.xAdministrator email address, used as email sender
ADMIN_NAMEOptional1.xAdministrator name, used as email sender display name

Upstash Redis

See Upstash Integration steps.

Environment VariableRequiredIntroduced InDescription
UPSTASH_REDIS_REST_URLOptional1.xRedis database URL
UPSTASH_REDIS_REST_TOKENOptional1.xRedis access token
DAY_MAX_SUBMISSIONSOptional1.xMaximum daily submission limit

Stripe

See Stripe Integration steps.

Environment VariableRequiredIntroduced InDescription
NEXT_PUBLIC_ENABLE_STRIPERequired1.xWhether to enable Stripe payment functionality
• Set to true: Enable Stripe payment functionality
• Set to false: Disable payment functionality, configuration items below can be left empty when disabled
NEXT_PUBLIC_DEFAULT_CURRENCYOptional1.xDefault payment currency
STRIPE_SECRET_KEYOptional1.xStripe secret key
STRIPE_PUBLISHABLE_KEYOptional1.xStripe publishable key
STRIPE_WEBHOOK_SECRETOptional1.xStripe Webhook signing secret
STRIPE_CUSTOMER_PORTAL_URLOptional1.xUser subscription management page URL, provides users with subscription information display and unsubscribe entry, default is /dashboard/subscription page
STRIPE_RADAR_EARLY_FRAUD_WARNING_TYPEOptional3.1.9Used to configure response behavior when Stripe Radar early fraud warning is triggered

STRIPE_RADAR_EARLY_FRAUD_WARNING_TYPE is used to configure response behavior when Stripe Radar early fraud warning is triggered:

Available values and their meanings:

  • "refund,email": Automatically refund and send email notification to admin
  • "refund": Only automatically refund
  • "email": Only send email notification to admin (no automatic refund)
  • Leave empty or unset to disable processing

For Discord notifications, you can extend the environment variable's optional values and implement Discord notifications using methods in lib/discord/notifications.ts.

Cloudflare R2 Storage

See Cloudflare R2 Integration steps.

Environment VariableRequiredIntroduced InDescription
R2_ACCOUNT_IDOptional1.xR2 storage account ID
R2_ACCESS_KEY_IDOptional1.xR2 access key ID
R2_SECRET_ACCESS_KEYOptional1.xR2 secret access key
R2_BUCKET_NAMEOptional1.xR2 bucket name
R2_PUBLIC_URLOptional1.xR2 bucket public access URL

AI Model Integration

Environment VariableRequiredIntroduced InDescription
OPENAI_API_KEYOptional1.xOpenAI API key
DEEPSEEK_API_KEYOptional1.xDeepSeek API key
ANTHROPIC_API_KEYOptional1.xAnthropic API key
XAI_API_KEYOptional1.xXAI API key
GOOGLE_GENERATIVE_AI_API_KEYOptional1.xGoogle API key
REPLICATE_API_TOKENOptional1.xReplicate API token
OPENROUTER_API_KEYOptional1.xOpenRouter API key
FIRECRAWL_API_KEYOptional3.1.7Firecrawl API key

AI Translation Feature

The pricing plan editor page and blog editor page provide AI multilingual translation functionality. You need to configure the corresponding AI model here to use it.

Environment VariableRequiredIntroduced InDescription
NEXT_PUBLIC_AI_PROVIDEROptional1.xAI model service provider, e.g., xai
NEXT_PUBLIC_AI_MODEL_IDOptional1.xAI model identifier, e.g., grok-3

Analytics and Advertising

Environment VariableRequiredIntroduced InDescription
NEXT_PUBLIC_GOOGLE_IDOptional1.xGoogle Analytics
NEXT_PUBLIC_BAIDU_TONGJIOptional1.xBaidu Analytics
NEXT_PUBLIC_PLAUSIBLE_SRCOptional2.xPlausible script source URL
NEXT_PUBLIC_PLAUSIBLE_DOMAINOptional2.xPlausible analytics domain
PLAUSIBLE_API_KEYOptional3.1.2Plausible API Key
PLAUSIBLE_URLOptional3.1.2Plausible server URL
NEXT_PUBLIC_GOOGLE_ADSENSE_IDOptional1.xGoogle AdSense

Discord WidgetBot

Environment VariableRequiredIntroduced InDescription
NEXT_PUBLIC_DISCORD_INVITE_URLOptional2.xDiscord invite link
DISCORD_WEBHOOK_URLOptional3.1.7Discord Notify Webhook URL

Affiliate (Tolt.io)

See Tolt Integration steps.

Environment VariableRequiredIntroduced InDescription
NEXT_PUBLIC_TOLT_IDOptional2.xTolt.io Affiliate ID