# Clerk Environment Variables for React + Vite # # 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) # CRITICAL: Must use VITE_ prefix for Vite to expose to client VITE_CLERK_PUBLISHABLE_KEY=pk_test_... # ========================================== # SECURITY NOTES # ========================================== # 1. NEVER commit .env.local to version control # Add .env.local to .gitignore # # 2. Must use VITE_ prefix for client-side variables # Without VITE_ prefix, variable won't be available # # 3. Only VITE_ prefixed vars are exposed to browser # Never use VITE_ prefix for secrets # # 4. Restart dev server after changing .env.local # Vite only reads env vars on startup # # 5. Use different keys for development and production # - Development: pk_test_... # - Production: pk_live_... # ========================================== # ACCESS IN CODE # ========================================== # Use import.meta.env to access: # const PUBLISHABLE_KEY = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY # ========================================== # REFERENCE # ========================================== # Vite Env Vars: https://vitejs.dev/guide/env-and-mode.html # Clerk Docs: https://clerk.com/docs/references/react/clerk-provider