Environment Variables
Website Basic Configuration
Environment Variable | Required | Description |
---|---|---|
NEXT_PUBLIC_SITE_URL | Required | Website 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_DETECTION | Required | Language 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_IMAGES | Optional | Whether to enable image optimization, recommended to set as true , this will save Vercel image optimization resources |
ALLOWED_REDIRECT_HOSTS | Optional | Domain 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 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 |
Advertisement 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 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 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 |
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 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 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 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 private access key |
R2_BUCKET_NAME | Optional | R2 bucket name |
R2_PUBLIC_URL | Optional | R2 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 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 |
STRIPE_SECRET_KEY | Optional | Stripe secret key |
STRIPE_PUBLISHABLE_KEY | Optional | Stripe publishable key |
STRIPE_WEBHOOK_SECRET | Optional | Stripe webhook signature key |
DEFAULT_CURRENCY | Optional | Default payment currency |
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 self-built reliability assurance |
STRIPE_CUSTOMER_PORTAL_URL | Optional | Customer 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 Variable | Required | Description |
---|---|---|
NEXT_PUBLIC_AI_MODEL_ID | Optional | AI model identifier |
NEXT_PUBLIC_AI_PROVIDER | Optional | AI model service provider |
If you don't need to use the AI translation feature, you don't need to configure the above environment variables.