Required variables
Authenticates requests to Groq’s API. The AI chatbot endpoint (Where to get it:
app/api/chat/route.ts) reads this value at runtime to initialize the Groq client.The portfolio renders fully without this key, but every chatbot request will fail with an authentication error if it is missing or invalid.Example format (not a real key):- Go to console.groq.com and sign in or create a free account.
- Navigate to API Keys in the left sidebar.
- Click Create API Key, give it a name, and copy the value.
Local development
Create a.env.local file in the root of the project and add your variables there. Next.js loads this file automatically during pnpm dev.
.env.local
Start the development server
Production (Vercel)
Vercel injects environment variables at build time and runtime. They are never stored in your repository.Open your project settings
In the Vercel dashboard, select your project and click Settings in the top navigation.
Add GROQ_API_KEY
Fill in the form:
- Key:
GROQ_API_KEY - Value: your Groq API key
- Environments: select Production, Preview, and Development as needed
If you set or update
GROQ_API_KEY after an existing deployment, you must redeploy for the change to take effect. Vercel does not hot-reload environment variables.Optional variables
NEXT_PUBLIC_* variables
Next.js exposes environment variables prefixed withNEXT_PUBLIC_ to the browser at build time. Use this pattern for values that are safe to be public (e.g., a public site URL, a public analytics ID).
.env.local
Vercel Analytics
The project already includes@vercel/analytics as a dependency. When deployed on Vercel, Analytics is enabled automatically — no extra environment variable is required. You can view traffic data in the Analytics tab of your Vercel project dashboard.
To enable analytics on other platforms or in custom setups, refer to the @vercel/analytics documentation.