Environment variables
Before deploying, make sure these variables are set in your hosting platform’s environment settings:| Variable | Required | Description |
|---|---|---|
NEXT_PUBLIC_CRAVEUP_API_KEY | Yes | Production API key from the Dashboard |
NEXT_PUBLIC_LOCATION_ID | Yes | Location ID to serve |
NEXT_PUBLIC_LOCATION_SLUG | Yes | Location slug for merchant lookups |
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY | Yes | Stripe publishable key for payments |
CRAVEUP_WEBHOOK_SECRET | If using webhooks | Secret for verifying webhook signatures |
Deploy to Vercel
Vercel is the recommended platform for Next.js storefronts. It provides edge caching, serverless functions, and preview deployments.Import in Vercel
Go to vercel.com/new, import your repository, and select the Next.js framework preset.
Custom domain
Add your domain in Vercel’s project settings under Domains. For a branded storefront, use a subdomain:Deploy to Netlify
Netlify requires the
@netlify/plugin-nextjs plugin for full Next.js support. Add it in your netlify.toml or install via the Netlify dashboard.Custom hosting
For Docker, VPS, or other setups, build and start the Next.js production server:Docker
Performance checklist
After deploying, verify these optimizations:- Images: Product images should be served through
next/imagefor automatic optimization - Caching: Location and menu data changes infrequently — cache it with
revalidatein server components - Bundle size: Run
npx next buildand check the output for large pages (aim for < 100kB first load JS) - Core Web Vitals: Test with PageSpeed Insights — aim for all green scores
Monitor in production
Track API errors and storefront health:Next steps
Analytics
Track storefront events and funnel performance.
Webhooks
Receive real-time order lifecycle notifications.