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 Variable | Required | Introduced In | Description |
|---|---|---|---|
NEXT_PUBLIC_SITE_URL | Required | 1.x | Website access URL • For local development, use the startup address, default is http://localhost:3000• For production environment, use your actual domain |
NEXT_PUBLIC_PRICING_PATH | Required | 2.x | Corresponds to the actual pricing plan page, default is /#pricing |
NEXT_PUBLIC_LOCALE_DETECTION | Required | 1.x | Language 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_IMAGES | Optional | 2.x | Whether to enable image optimization, recommended to set as true, which can save Vercel image optimization resources |
NEXT_PUBLIC_LOGIN_MODE | Optional | 2.x | Select login mode: page opens login page /login, dialog opens login modal |
NEXT_PUBLIC_COOKIE_CONSENT_ENABLED | Optional | 3.1.6 | Whether 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 Variable | Required | Introduced In | Description |
|---|---|---|---|
DATABASE_URL | Required | 3.0.0 |
Authorization
See Authorization Integration steps.
| Environment Variable | Required | Introduced In | Description |
|---|---|---|---|
BETTER_AUTH_SECRET | Optional | 3.0.0 | Generate using command openssl rand -base64 32 |
NEXT_PUBLIC_GITHUB_CLIENT_ID | Optional | 3.0.0 | |
GITHUB_CLIENT_SECRET | Optional | 3.0.0 | |
NEXT_PUBLIC_GOOGLE_CLIENT_ID | Optional | 3.0.0 | |
GOOGLE_CLIENT_SECRET | Optional | 3.0.0 |
Cloudflare Turnstile
See Turnstile Integration steps.
| Environment Variable | Required | Introduced In | Description |
|---|---|---|---|
NEXT_PUBLIC_TURNSTILE_SITE_KEY | Optional | 2.x | Cloudflare Turnstile will be enabled when filled |
TURNSTILE_SECRET_KEY | Optional | 3.0.0 |
Resend Email Service
See Resend Integration steps.
| Environment Variable | Required | Introduced In | Description |
|---|---|---|---|
RESEND_API_KEY | Optional | 1.x | Resend API access key |
RESEND_AUDIENCE_ID | Optional | 1.x | Resend audience ID |
ADMIN_EMAIL | Optional | 1.x | Administrator email address, used as email sender |
ADMIN_NAME | Optional | 1.x | Administrator name, used as email sender display name |
Upstash Redis
See Upstash Integration steps.
| Environment Variable | Required | Introduced In | Description |
|---|---|---|---|
UPSTASH_REDIS_REST_URL | Optional | 1.x | Redis database URL |
UPSTASH_REDIS_REST_TOKEN | Optional | 1.x | Redis access token |
DAY_MAX_SUBMISSIONS | Optional | 1.x | Maximum daily submission limit |
Stripe
See Stripe Integration steps.
| Environment Variable | Required | Introduced In | Description |
|---|---|---|---|
NEXT_PUBLIC_ENABLE_STRIPE | Required | 1.x | Whether 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_CURRENCY | Optional | 1.x | Default payment currency |
STRIPE_SECRET_KEY | Optional | 1.x | Stripe secret key |
STRIPE_PUBLISHABLE_KEY | Optional | 1.x | Stripe publishable key |
STRIPE_WEBHOOK_SECRET | Optional | 1.x | Stripe Webhook signing secret |
STRIPE_CUSTOMER_PORTAL_URL | Optional | 1.x | User subscription management page URL, provides users with subscription information display and unsubscribe entry, default is /dashboard/subscription page |
STRIPE_RADAR_EARLY_FRAUD_WARNING_TYPE | Optional | 3.1.9 | Used 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 Variable | Required | Introduced In | Description |
|---|---|---|---|
R2_ACCOUNT_ID | Optional | 1.x | R2 storage account ID |
R2_ACCESS_KEY_ID | Optional | 1.x | R2 access key ID |
R2_SECRET_ACCESS_KEY | Optional | 1.x | R2 secret access key |
R2_BUCKET_NAME | Optional | 1.x | R2 bucket name |
R2_PUBLIC_URL | Optional | 1.x | R2 bucket public access URL |
AI Model Integration
| Environment Variable | Required | Introduced In | Description |
|---|---|---|---|
OPENAI_API_KEY | Optional | 1.x | OpenAI API key |
DEEPSEEK_API_KEY | Optional | 1.x | DeepSeek API key |
ANTHROPIC_API_KEY | Optional | 1.x | Anthropic API key |
XAI_API_KEY | Optional | 1.x | XAI API key |
GOOGLE_GENERATIVE_AI_API_KEY | Optional | 1.x | Google API key |
REPLICATE_API_TOKEN | Optional | 1.x | Replicate API token |
OPENROUTER_API_KEY | Optional | 1.x | OpenRouter API key |
FIRECRAWL_API_KEY | Optional | 3.1.7 | Firecrawl 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 Variable | Required | Introduced In | Description |
|---|---|---|---|
NEXT_PUBLIC_AI_PROVIDER | Optional | 1.x | AI model service provider, e.g., xai |
NEXT_PUBLIC_AI_MODEL_ID | Optional | 1.x | AI model identifier, e.g., grok-3 |
Analytics and Advertising
| Environment Variable | Required | Introduced In | Description |
|---|---|---|---|
NEXT_PUBLIC_GOOGLE_ID | Optional | 1.x | Google Analytics |
NEXT_PUBLIC_BAIDU_TONGJI | Optional | 1.x | Baidu Analytics |
NEXT_PUBLIC_PLAUSIBLE_SRC | Optional | 2.x | Plausible script source URL |
NEXT_PUBLIC_PLAUSIBLE_DOMAIN | Optional | 2.x | Plausible analytics domain |
PLAUSIBLE_API_KEY | Optional | 3.1.2 | Plausible API Key |
PLAUSIBLE_URL | Optional | 3.1.2 | Plausible server URL |
NEXT_PUBLIC_GOOGLE_ADSENSE_ID | Optional | 1.x | Google AdSense |
Discord WidgetBot
| Environment Variable | Required | Introduced In | Description |
|---|---|---|---|
NEXT_PUBLIC_DISCORD_INVITE_URL | Optional | 2.x | Discord invite link |
DISCORD_WEBHOOK_URL | Optional | 3.1.7 | Discord Notify Webhook URL |
Affiliate (Tolt.io)
See Tolt Integration steps.
| Environment Variable | Required | Introduced In | Description |
|---|---|---|---|
NEXT_PUBLIC_TOLT_ID | Optional | 2.x | Tolt.io Affiliate ID |