Menu

Environment Variables

Website Basic Configuration

Environment VariableRequiredDescription
NEXT_PUBLIC_SITE_URLRequiredWebsite access URL
• For local development, use the startup address, default is http://localhost:3000
• For production environment, please use your actual domain name
NEXT_PUBLIC_LOCALE_DETECTIONRequiredLanguage detection mode, recommended to set as false
• Set to true: Enable next-intl automatic detection, will automatically redirect to corresponding language page based on browser language
• Set to false: Use Nexty.dev's built-in SEO-friendly language detector
NEXT_PUBLIC_OPTIMIZED_IMAGESOptionalWhether to enable image optimization, recommended to set as true, this will save Vercel image optimization resources
ALLOWED_REDIRECT_HOSTSOptionalDomain whitelist allowed for redirection after successful login, only effective in development environment

Good to know

Nexty.dev's language detector checks the browser language when users first visit. If it doesn't match the current page language, it will show a friendly switching prompt. From the second visit onwards, the system will automatically redirect to the user's preferred language page based on cookie records. This approach reduces unnecessary redirects and is more SEO-friendly.

Discord WidgetBot

Environment VariableRequiredDescription
NEXT_PUBLIC_DISCORD_INVITE_URLOptionalDiscord invitation link

Data Analytics

Environment VariableRequiredDescription
NEXT_PUBLIC_GOOGLE_IDOptionalGoogle Analytics
NEXT_PUBLIC_BAIDU_TONGJIOptionalBaidu Analytics
NEXT_PUBLIC_PLAUSIBLE_DOMAINOptionalPlausible analytics domain
NEXT_PUBLIC_PLAUSIBLE_SRCOptionalPlausible script source address
Environment VariableRequiredDescription
NEXT_PUBLIC_GOOGLE_ADSENSE_IDOptionalGoogle AdSense

Supabase Database

Supabase provides data storage and user authentication services.

Environment VariableRequiredDescription
NEXT_PUBLIC_SUPABASE_URLRequiredSupabase project URL
NEXT_PUBLIC_SUPABASE_ANON_KEYRequiredSupabase anonymous access key
SUPABASE_SERVICE_ROLE_KEYRequiredSupabase server-side role key

If you don't have a Supabase account yet, please refer to the Supabase Integration section to complete the configuration.

Resend Email Service

Resend is a professional email delivery service. Nexty.dev implements email notification functionality based on it.

Environment VariableRequiredDescription
RESEND_API_KEYOptionalResend API access key
RESEND_AUDIENCE_IDOptionalResend audience ID
ADMIN_EMAILOptionalAdministrator email address, used as email sender
ADMIN_NAMEOptionalAdministrator name, used as email sender display name

For information on how to obtain RESEND_API_KEY and RESEND_AUDIENCE_ID, please refer to the Resend Integration section.

Upstash Redis Cache

Upstash Redis is used for data caching and request rate limiting scenarios.

Nexty.dev uses Upstash Redis in the email subscription functionality to limit daily submission counts. This implementation can serve as a reference case. When your product encounters traffic attacks, you can quickly intercept malicious requests based on the built-in rate limiter.

Environment VariableRequiredDescription
UPSTASH_REDIS_REST_URLOptionalRedis database URL
UPSTASH_REDIS_REST_TOKENOptionalRedis access token
UPSTASH_REDIS_NEWSLETTER_RATE_LIMIT_KEYOptionalRedis key name for email subscription rate limiting
DAY_MAX_SUBMISSIONSOptionalDaily maximum submission limit

For information on how to obtain UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN, please refer to the Upstash Integration section.

Cloudflare R2 Storage

Cloudflare R2 provides file storage services. Nexty.dev uses it to save user avatars, AI-generated images and videos, blog illustrations, and other resources.

Environment VariableRequiredDescription
R2_ACCOUNT_IDOptionalR2 storage account ID
R2_ACCESS_KEY_IDOptionalR2 access key ID
R2_SECRET_ACCESS_KEYOptionalR2 private access key
R2_BUCKET_NAMEOptionalR2 bucket name
R2_PUBLIC_URLOptionalR2 bucket public access URL

For information on how to obtain these environment variables, please refer to the Cloudflare R2 Integration section.

AI Model Integration

Nexty.dev provides an AI Demo page for testing various AI model capabilities. If you're unfamiliar with AI functionality integration, you can refer to the code implementation of this page.

Environment VariableRequiredDescription
OPENAI_API_KEYOptionalOpenAI API key
DEEPSEEK_API_KEYOptionalDeepSeek API key
ANTHROPIC_API_KEYOptionalAnthropic API key
XAI_API_KEYOptionalXAI API key
GOOGLE_API_KEYOptionalGoogle API key
REPLICATE_API_TOKENOptionalReplicate API token
OPENROUTER_API_KEYOptionalOpenRouter API key

Stripe Payment

Environment VariableRequiredDescription
NEXT_PUBLIC_ENABLE_STRIPERequiredWhether to enable Stripe payment functionality
• Set to true: Enable Stripe payment functionality
• Set to false: Disable payment functionality, the following configuration items can be left empty
STRIPE_SECRET_KEYOptionalStripe secret key
STRIPE_PUBLISHABLE_KEYOptionalStripe publishable key
STRIPE_WEBHOOK_SECRETOptionalStripe webhook signature key
DEFAULT_CURRENCYOptionalDefault payment currency
STRIPE_WEBHOOK_ASYNC_PROCESSINGOptionalStripe webhook processing mode
• Set to false: Rely on Stripe's retry mechanism (recommended)
• Set to true: Enable asynchronous processing, faster response but requires self-built reliability assurance
STRIPE_CUSTOMER_PORTAL_URLOptionalCustomer subscription management page URL

For information on how to obtain STRIPE_SECRET_KEY, STRIPE_PUBLISHABLE_KEY, and STRIPE_WEBHOOK_SECRET, please refer to the Stripe Integration section.

AI Translation Feature

Nexty.dev has built-in AI multilingual translation functionality in the pricing card creation and editing pages, which requires configuring the corresponding AI model to use.

Environment VariableRequiredDescription
NEXT_PUBLIC_AI_MODEL_IDOptionalAI model identifier
NEXT_PUBLIC_AI_PROVIDEROptionalAI model service provider

If you don't need to use the AI translation feature, you don't need to configure the above environment variables.