Configuration
Invalid Date•Preet Suthar
The Next.js Startup Boilerplate requires configuration for various services and integrations. This section provides an overview of the configuration process.
Environment Variables #
Create a .env.local
file in the project root and add the following variables:
# -----------------------------------------------------
# NEXT-AUTH CONFIGURATION
# -----------------------------------------------------
NEXTAUTH_SECRET=your_secret_key
NEXTAUTH_URL=http://localhost:3000
# -----------------------------------------------------
# GOOGLE PROVIDER
# -----------------------------------------------------
GOOGLE_CLIENT_ID=your_client_id
GOOGLE_CLIENT_SECRET=your_client_secret
# -----------------------------------------------------
# MONGODB
# -----------------------------------------------------
MONGODB_URI=your_mongodb_uri
# -----------------------------------------------------
# LEMON SQUEEZY PAYMENT INTEGRATION
# -----------------------------------------------------
LEMON_SQUEEZY_API_KEY=your_api_key
LEMON_SQUEEZY_WEBHOOK_SIGNATURE=your_webhook_secret
LEMON_SQUEEZY_STORE_ID=your_store_id
NEXT_PUBLIC_LEMON_SQUEEZY_BASIC_VARIANT_ID=your_variant_id
💡 Tip: Generate NEXTAUTH_SECRET
using this command:
openssl rand -base64 32
Variable | Source |
---|---|
NEXTAUTH_SECRET |
Generate using openssl command |
NEXTAUTH_URL |
Localhost URL for development or your live domain |
GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET |
Google Cloud Console, OAuth credentials |
MONGODB_URI |
MongoDB Dashboard |
LEMON_SQUEEZY_API_KEY |
Lemon Squeezy Dashboard, API Keys |
LEMON_SQUEEZY_WEBHOOK_SIGNATURE |
Lemon Squeezy Dashboard, Webhook configuration |
LEMON_SQUEEZY_STORE_ID |
Lemon Squeezy Dashboard, Store Settings |
NEXT_PUBLIC_LEMON_SQUEEZY_BASIC_VARIANT_ID |
Lemon Squeezy Dashboard, Product Variants |
By setting these environment variables, your application will be ready to connect to all required services.