vercel-deployment

Configure and deploy Next.js applications to Vercel with environment variables and runtimes.

1|Updated Aug 4, 2026
One-click install
npx skills add https://github.com/Hamzaoui-Louai/LEAN-gym-dashboard-frontend --skill vercel-deployment-hamzaoui-louai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vercel-deployment
Source: https://github.com/Hamzaoui-Louai/LEAN-gym-dashboard-frontend/tree/main/.opencode/skills/vercel-deployment
Command: npx skills add https://github.com/Hamzaoui-Louai/LEAN-gym-dashboard-frontend --skill vercel-deployment-hamzaoui-louai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Deploying Next.js applications to Vercel involves many pitfalls: leaked secrets via NEXT_PUBLIC_ variables, wrong runtime choices, oversized serverless functions, stale caches, and CORS failures. This Skill provides expert patterns and sharp-edge warnings to deploy correctly the first time. ## Core Features & Use Cases - Environment Variable Management: Correctly separate Development, Preview, and Production variables and avoid exposing secrets to the browser. - Runtime Selection: Choose between Edge and Node.js serverless runtimes for API routes and middleware based on API compatibility and cold-start needs. - Production Readiness: Optimize builds, configure custom domains, set up preview deployment workflows, and control caching with ISR and on-demand revalidation. - Use Case: When a PR preview deployment corrupts production data because it shares the production database, use this Skill to configure per-environment DATABASE_URL values and staging branches. ## Quick Start Ask the AI to review your Next.js project and configure it for a safe production deployment on Vercel.

Frequently Asked Questions about vercel-deployment

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deploy a Next.js app to Vercel with environment variables?

Configure variables in Vercel Dashboard under Settings → Environment Variables, separating Development, Preview, and Production values. Use NEXT_PUBLIC_ only for public values like anon keys; keep secrets like DATABASE_URL server-only.

Edge runtime vs serverless Node.js runtime on Vercel, which should I use?

Use the Edge runtime for fast cold starts and simple tasks like auth checks and redirects. Use the Node.js serverless runtime when you need fs, database drivers, or native modules, since Edge lacks most Node.js APIs.

Why is my NEXT_PUBLIC_ environment variable a security risk?

NEXT_PUBLIC_ variables are inlined into the browser JavaScript bundle at build time, so anyone can read them in DevTools. Never prefix secrets like SUPABASE_SERVICE_ROLE_KEY, STRIPE_SECRET_KEY, or DATABASE_URL with NEXT_PUBLIC_.

Why does my Vercel serverless function have slow cold starts?

Large function bundles, often from heavy dependencies like sharp or puppeteer, cause 1-5+ second cold starts and can exceed the 50MB limit. Use dynamic imports, move work to the Edge runtime, or offload heavy tasks to external services.

Why does my Vercel page show stale data after deployment?

Vercel caches static and dynamic pages at the edge, serving old versions until the cache expires. Set export const revalidate, use force-dynamic, or call revalidatePath and revalidateTag after mutations to purge cached content.

How do I fix CORS errors calling Vercel API routes from another domain?

Add Access-Control-Allow-Origin, Allow-Methods, and Allow-Headers headers to your API route responses, and implement an OPTIONS handler for preflight requests. You can also set headers globally for /api/:path* in next.config.js.