Environment Variables (Nexty)
Good to know
Since Nexty provides multiple repositories, each repository has different environment variables. Please refer to the corresponding environment variable documentation:
Website Basic Configuration
Environment Variable | Required | Description |
---|---|---|
NEXT_PUBLIC_SITE_URL | Required | Website access URL • For local development, use the startup address (default: http://localhost:3000 )• For production environment, use your actual domain name |
NEXT_PUBLIC_PRICING_PATH | Required | Pricing plan page path (default: /#pricing ) |
NEXT_PUBLIC_LOCALE_DETECTION | Required | Language detection mode (recommended: 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_IMAGES | Optional | Whether to enable image optimization, recommended to set as true to save Vercel image optimization resources |
NEXT_PUBLIC_LOGIN_MODE | Optional | Choose login mode: page opens login page, dialog opens login modal |
ALLOWED_REDIRECT_HOSTS | Optional | Whitelist of allowed redirect domains after successful login, only effective in development environment |
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, it displays a friendly switching prompt. From the second visit onwards, the system automatically redirects to the user's preferred language page based on cookie records. This approach reduces unnecessary redirects and is more SEO-friendly.
Discord WidgetBot
Environment Variable | Required | Description |
---|---|---|
NEXT_PUBLIC_DISCORD_INVITE_URL | Optional | Discord invitation link |
Data Analytics
Environment Variable | Required | Description |
---|---|---|
NEXT_PUBLIC_GOOGLE_ID | Optional | Google Analytics |
NEXT_PUBLIC_BAIDU_TONGJI | Optional | Baidu Analytics |
NEXT_PUBLIC_PLAUSIBLE_DOMAIN | Optional | Plausible analytics domain |
NEXT_PUBLIC_PLAUSIBLE_SRC | Optional | Plausible script source address |
Advertising Configuration
Environment Variable | Required | Description |
---|---|---|
NEXT_PUBLIC_GOOGLE_ADSENSE_ID | Optional | Google AdSense |
Supabase Database
Supabase provides data storage and user authentication services.
Environment Variable | Required | Description |
---|---|---|
NEXT_PUBLIC_SUPABASE_URL | Required | Supabase project URL |
NEXT_PUBLIC_SUPABASE_ANON_KEY | Required | Supabase anonymous access key |
SUPABASE_SERVICE_ROLE_KEY | Required | Supabase service role key |
NEXT_PUBLIC_GOOGLE_CLIENT_ID | Optional | Google 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 Variable | Required | Description |
---|---|---|
RESEND_API_KEY | Optional | Resend API access key |
RESEND_AUDIENCE_ID | Optional | Resend audience ID |
ADMIN_EMAIL | Optional | Administrator email address, used as email sender |
ADMIN_NAME | Optional | Administrator name, used as email sender display name |
NEXT_PUBLIC_USER_WELCOME | Optional | [Enabled in v2.2.0] Whether to send welcome email for new user registration, default false (no sending), set to true to send |
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 in the email subscription feature to limit daily submission counts. This implementation can serve as a reference case when your product encounters traffic attacks, allowing you to quickly intercept malicious requests based on the built-in rate limiter.
Environment Variable | Required | Description |
---|---|---|
UPSTASH_REDIS_REST_URL | Optional | Redis database URL |
UPSTASH_REDIS_REST_TOKEN | Optional | Redis access token |
UPSTASH_REDIS_NEWSLETTER_RATE_LIMIT_KEY | Optional | Redis key name for email subscription rate limiting |
DAY_MAX_SUBMISSIONS | Optional | Daily 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 Variable | Required | Description |
---|---|---|
R2_ACCOUNT_ID | Optional | R2 storage account ID |
R2_ACCESS_KEY_ID | Optional | R2 access key ID |
R2_SECRET_ACCESS_KEY | Optional | R2 secret access key |
R2_BUCKET_NAME | Optional | R2 bucket name |
R2_PUBLIC_URL | Optional | R2 bucket public access URL |
For methods to obtain R2-related environment variables, please refer to the Cloudflare R2 Integration chapter.
Cloudflare Turnstile
Environment Variable | Required | Description |
---|---|---|
NEXT_PUBLIC_TURNSTILE_SITE_KEY | Optional | Fill 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 functionality integration, you can refer to the code implementation of this page.
Environment Variable | Required | Description |
---|---|---|
OPENAI_API_KEY | Optional | OpenAI API key |
DEEPSEEK_API_KEY | Optional | DeepSeek API key |
ANTHROPIC_API_KEY | Optional | Anthropic API key |
XAI_API_KEY | Optional | XAI API key |
GOOGLE_API_KEY | Optional | Google API key |
REPLICATE_API_TOKEN | Optional | Replicate API token |
OPENROUTER_API_KEY | Optional | OpenRouter API key |
Stripe Payment
Environment Variable | Required | Description |
---|---|---|
NEXT_PUBLIC_ENABLE_STRIPE | Required | Whether 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_CURRENCY | Optional | Default payment currency |
STRIPE_SECRET_KEY | Optional | Stripe secret key |
STRIPE_PUBLISHABLE_KEY | Optional | Stripe publishable key |
STRIPE_WEBHOOK_SECRET | Optional | Stripe webhook signature secret |
STRIPE_WEBHOOK_ASYNC_PROCESSING | Optional | Stripe 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_URL | Optional | User subscription management page URL, provides users with subscription information display and unsubscription entry, default is /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 editing page and blog editing page provide AI multilingual translation functionality. You need to configure the corresponding AI model here to use this feature.
Environment Variable | Required | Description |
---|---|---|
NEXT_PUBLIC_AI_PROVIDER | Optional | AI model service provider |
NEXT_PUBLIC_AI_MODEL_ID | Optional | AI 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 Variable | Required | Description |
---|---|---|
NEXT_PUBLIC_TOLT_ID | Optional | Tolt.io Affiliate ID |