Lesson 812 lessons
Deploying to Vercel
Connecting your repo
Push your Next.js project to GitHub, then import it in the Vercel dashboard. Vercel auto-detects Next.js and configures the build. Every push to main triggers a production deploy; every PR gets a preview URL.
Setting environment variables
Add ANTHROPIC_API_KEY in Vercel → Project Settings → Environment Variables. Never commit it to the repo. Set it for Production, Preview, and Development environments as needed.
Verifying the live deployment
After deploy, test your API route on the live URL, check Vercel's function logs for errors, and confirm response times are acceptable (cold starts can add latency on the first request).
Key Takeaways
- Vercel auto-builds Next.js from a connected GitHub repo.
- API keys go in Vercel environment variables, never in the repo.
- Every PR gets its own preview deployment for testing.
- Check function logs after deploy to catch runtime errors.
Deploy your Claude app
Push your project to GitHub, import it into Vercel, add your API key as an environment variable, and confirm your `/api/ask` route works on the live deployment.