Menu

Environment Variables (Nexty)

Good to know

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

Website Basic Configuration

Environment VariableRequiredDescription
NEXT_PUBLIC_SITE_URLRequiredWebsite access URL
• For local development, fill in the startup address, default is http://localhost:3000
• For production environment, please fill in your actual domain name
NEXT_PUBLIC_PRICING_PATHRequiredPricing plan page, default is /#pricing
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 can save Vercel image optimization resources
NEXT_PUBLIC_LOGIN_MODEOptionalChoose login mode: page opens login page, dialog opens login modal
ALLOWED_REDIRECT_HOSTSOptionalDomain whitelist for allowed redirects after successful login, only effective in development environment

Good to know

Nexty.dev's language detector checks 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 invite 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 service role key
NEXT_PUBLIC_GOOGLE_CLIENT_IDNot RequiredGoogle client ID (v1.1.9)

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

Resend Email Service

Resend is a professional email sending 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 methods to obtain RESEND_API_KEY and RESEND_AUDIENCE_ID, please refer to the Resend Integration chapter.

Upstash Redis Cache

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

Nexty.dev uses Upstash Redis to limit daily submission frequency in the email subscription feature. 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 methods to obtain UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN, please refer to the Upstash Integration chapter.

Cloudflare R2 Storage

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

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

For methods to obtain R2-related environment variables, please refer to the Cloudflare R2 Integration chapter.

Cloudflare Turnstile

Environment VariableRequiredDescription
NEXT_PUBLIC_TURNSTILE_SITE_KEYOptionalFill in to enable Cloudflare Turnstile

For methods to obtain Cloudflare Turnstile environment variables, please refer to the Enable Cloudflare Turnstile chapter.

AI Model Integration

Nexty.dev provides an AI Demo page for testing various AI model capabilities. If you're unfamiliar with AI feature 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
NEXT_PUBLIC_DEFAULT_CURRENCYOptionalDefault payment currency
STRIPE_SECRET_KEYOptionalStripe secret key
STRIPE_PUBLISHABLE_KEYOptionalStripe publishable key
STRIPE_WEBHOOK_SECRETOptionalStripe webhook signature key
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 implementing webhook processing logic yourself
STRIPE_CUSTOMER_PORTAL_URLOptionalUser subscription management page URL, provides users with subscription information display and unsubscription entry point, defaults to /dashboard/subscription page

For methods to obtain STRIPE_SECRET_KEY, STRIPE_PUBLISHABLE_KEY, and STRIPE_WEBHOOK_SECRET, please refer to the Stripe Integration chapter.

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 VariableRequiredDescription
NEXT_PUBLIC_AI_PROVIDEROptionalAI model service provider
NEXT_PUBLIC_AI_MODEL_IDOptionalAI model identifier

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

Affiliate(Tolt.io)

Environment VariableRequiredDescription
NEXT_PUBLIC_TOLT_IDOptionalTolt.io Affiliate ID