원클릭으로
vercel-expert
Vercel deployment patterns — environments, env vars, preview deployments, ISR, and edge config for Next.js
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Vercel deployment patterns — environments, env vars, preview deployments, ISR, and edge config for Next.js
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Activates when working with Python data pipelines, GCS operations, or medallion architecture (Bronze/Silver/Gold). Use this skill for: running pipelines, debugging data transformations, GCS uploads/downloads, data quality validation, CVR/CHR/BFE identifier handling, GeoPandas/PostGIS operations, and DuckDB queries for large files. Keywords: pipeline, bronze, silver, gold, GCS, parquet, CVR, CHR, BFE, transform, ingest, ETL, DuckDB, large files
Activates when querying livestock and animal data from R2. Use this skill for: CHR registry, pig movements, animal welfare, antibiotics, animal density, mortality rates, herd tracking, svineflytning. Keywords: husdyr, livestock, animal, dyr, CHR, svin, pig, ko, cattle, antibiotika, dyrevelfærd, flytning, movement
Activates when querying agricultural land and field data from R2. Use this skill for: field boundaries, crop data, land use, organic farming, production estimates, cadastral data, agricultural blocks, building data. Keywords: landbrugsareal, field, mark, marker, crop, afgrøde, organic, økologisk, production, areal, cadastral, matrikel
Activates when querying employee and workplace safety data from R2. Use this skill for: Arbejdstilsynet inspections, work permits, safety violations, workplace accidents, compliance rates, foreign workers, incident tracking. Keywords: medarbejdere, employees, worker, arbejdstilsynet, inspection, tilsyn, safety, arbejdsmiljø, accident, ulykke, compliance
Activates when querying environmental data from R2. Use this skill for: pesticides, nitrogen leaching, BNBO drinking water protection, wetlands, soil types, environmental compliance, biodiversity. Keywords: miljø, environment, pesticide, pesticid, nitrogen, kvælstof, BNBO, wetlands, vådomr, soil, jord, biodiversity
Activates when querying financial/economic data from R2. Use this skill for: subsidies, farm financials, property values, CVR enrichment, ownership data, støtte per hektar, samlet støtte, grundværdi. Keywords: økonomi, finance, subsidies, støtte, tilskud, CVR, property, ejendom, grundværdi
| name | vercel-expert |
| description | Vercel deployment patterns — environments, env vars, preview deployments, ISR, and edge config for Next.js |
Vercel has three built-in environments:
| Environment | Trigger | URL |
|---|---|---|
| Production | Push/merge to main | Your domain |
| Preview | Push to any other branch / PR | Auto-generated URL |
| Local | npm run dev | localhost:3000 |
Custom environments (staging, qa) available on Pro+ plans.
# Pull env vars for local development
vercel link # link local dir to Vercel project
vercel env pull # populates .env.local
# Add env var via CLI
vercel env add MY_SECRET production
vercel env add MY_SECRET preview
vercel env add MY_SECRET development
# Deploy to custom environment
vercel deploy --target=staging
vercel env pull --environment=staging
In code, always access via process.env.MY_VAR. Client-safe vars must be prefixed NEXT_PUBLIC_.
# Preview deploy (default)
vercel
# Production deploy
vercel --prod
Every push to a non-main branch automatically creates a Preview deployment with:
// Tag-based revalidation (preferred)
const res = await fetch('https://api.example.com/posts', {
next: { tags: ['posts'], revalidate: 3600 }
})
// Revalidate on-demand in a Server Action
import { revalidateTag } from 'next/cache'
revalidateTag('posts')
// Time-based ISR
const res = await fetch('https://api.example.com/posts', {
next: { revalidate: 60 } // seconds
})
On Vercel, ISR pages are:
// Route Handler reading Vercel geo headers
export function GET(request: NextRequest) {
const country = request.headers.get('x-vercel-ip-country')
const city = request.headers.get('x-vercel-ip-city')
return NextResponse.json({ country, city })
}
import type { NextConfig } from 'next'
const config: NextConfig = {
// Redirect
async redirects() {
return [{ source: '/old', destination: '/new', permanent: true }]
},
// Rewrite (proxy)
async rewrites() {
return [{ source: '/api/:path*', destination: 'https://backend.example.com/:path*' }]
},
// Security headers
async headers() {
return [{
source: '/(.*)',
headers: [
{ key: 'X-Frame-Options', value: 'DENY' },
{ key: 'X-Content-Type-Options', value: 'nosniff' },
{ key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' },
],
}]
},
// Image domains
images: {
remotePatterns: [{ protocol: 'https', hostname: '**.supabase.co' }],
},
}
export default config
The project uses proxy.ts (Next.js 16 naming) for session refresh. In Vercel, proxy/middleware runs at the Edge globally before any cache:
export const config = {
matcher: ['/((?!_next/static|_next/image|favicon.ico|.*\\.(?:svg|png|jpg|jpeg|gif|webp)$).*)'],
}
// app/layout.tsx
import { Analytics } from '@vercel/analytics/next'
import { SpeedInsights } from '@vercel/speed-insights/next'
export default function RootLayout({ children }) {
return (
<html>
<body>
{children}
<Analytics />
<SpeedInsights />
</body>
</html>
)
}
// app/opengraph-image.tsx — no extra package needed
import { ImageResponse } from 'next/og'
// @vercel/og is included in next/og automatically
.env.local — it's gitignoredvercel env pull to sync env vars to localNEXT_PUBLIC_ prefix only for values safe to expose to the browser