Environment Variables
Before deploying, ensure you have all required environment variables:.env.local
Vercel (Recommended)
Import in Vercel
- Go to vercel.com/new 2. Import your repository 3. Set Root
Directory to
nextjs-minimalif using the monorepo structure
Add Environment Variables
In Project Settings ā Environment Variables, add: -
TOUGH_TONGUE_API_KEY = your API
key - NEXT_PUBLIC_IS_DEV = false - ADMIN_TOKEN = your secure token - Firebase variables
(if using)Vercel Project Settings
| Setting | Value |
|---|---|
| Framework | Next.js (auto-detected) |
| Build Command | pnpm build |
| Output Directory | .next |
| Install Command | pnpm install |
| Root Directory | nextjs-minimal (if monorepo) |
Custom Domain
After deployment, add a custom domain:- Go to Project Settings ā Domains
- Add your domain
- Update DNS records as instructed
- SSL is automatic
Other Platforms
Netlify
Docker
Self-Hosted
Customization
App Branding
Editlib/config.ts:
Scenario IDs
Updatelib/ttai/constants.ts with your scenarios:
Styling
Customize the theme intailwind.config.ts:
Production Checklist
Set
NEXT_PUBLIC_IS_DEV=falseUse strong
ADMIN_TOKENVerify
TOUGH_TONGUE_API_KEY is correctConfigure Firebase authorized domains
Test all user flows
Monitor API usage in Developer Portal
Set up error monitoring (optional)
Troubleshooting
Build fails on Vercel
Build fails on Vercel
Check:
- Root directory is set correctly (
nextjs-minimalif monorepo) - All environment variables are added
- No TypeScript errors: run
pnpm buildlocally first
Firebase auth not working in production
Firebase auth not working in production
Solution: - Add your production domain to Firebase authorized domains - Go to Firebase Console
ā Authentication ā Settings ā Authorized domains
API calls failing
API calls failing
Check: -
TOUGH_TONGUE_API_KEY is set in Vercel environment variables - API key has correct
permissions - Check Vercel function logs for errorsAdmin panel accessible in production
Admin panel accessible in production
Solution:
- Ensure
NEXT_PUBLIC_IS_DEV=falseis set - Redeploy after changing environment variables
Learn More
API Reference
Full API documentation
Troubleshooting
Common issues and solutions
Developer Portal
Manage API keys and usage