# Clerk Environment Variables for Next.js # # Copy this file to .env.local and fill in your actual values # Get your keys from https://dashboard.clerk.com # ========================================== # REQUIRED # ========================================== # Publishable Key (safe to expose to client) NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_... # Secret Key (NEVER expose to client, server-side only) CLERK_SECRET_KEY=sk_test_... # ========================================== # OPTIONAL - Custom Pages # ========================================== # Uncomment to use custom sign-in/sign-up pages # NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in # NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up # ========================================== # OPTIONAL - Redirect URLs # ========================================== # Where to redirect after sign-in (forced - always goes here) # NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/dashboard # Where to redirect after sign-up (forced - always goes here) # NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/onboarding # Fallback redirect if no forced redirect is set (default: /) # NEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URL=/ # NEXT_PUBLIC_CLERK_SIGN_UP_FALLBACK_REDIRECT_URL=/ # ========================================== # OPTIONAL - Webhooks # ========================================== # Webhook signing secret for verifying Clerk webhooks # Get this from Clerk Dashboard > Webhooks > Add Endpoint # CLERK_WEBHOOK_SIGNING_SECRET=whsec_... # ========================================== # OPTIONAL - Multi-Domain (Satellite Domains) # ========================================== # For multi-domain authentication # NEXT_PUBLIC_CLERK_DOMAIN=accounts.yourdomain.com # NEXT_PUBLIC_CLERK_IS_SATELLITE=true # ========================================== # OPTIONAL - Advanced Configuration # ========================================== # Custom Clerk JS URL (usually not needed) # NEXT_PUBLIC_CLERK_JS_URL=https://... # Proxy URL for requests (enterprise feature) # NEXT_PUBLIC_CLERK_PROXY_URL=https://... # Disable telemetry # CLERK_TELEMETRY_DISABLED=1 # ========================================== # SECURITY NOTES # ========================================== # 1. NEVER commit .env.local to version control # Add .env.local to .gitignore # # 2. Use different keys for development and production # - Development: pk_test_... / sk_test_... # - Production: pk_live_... / sk_live_... # # 3. NEVER use NEXT_PUBLIC_ prefix for secrets # NEXT_PUBLIC_ variables are exposed to the browser # # 4. Rotate CLERK_SECRET_KEY if compromised # Generate new keys in Clerk Dashboard # ========================================== # REFERENCE # ========================================== # Official Docs: # https://clerk.com/docs/guides/development/clerk-environment-variables