Skip to main content
The @sveltejs/adapter-vercel adapter deploys your SvelteKit app to Vercel.

Installation

Usage

Add the adapter to your svelte.config.js:

Configuration options

From the adapter type definitions:

runtime

The runtime to use for your app. Can be a Node.js version or 'edge'.
The runtime: 'edge' option is deprecated and will be removed in a future version. Use serverless functions instead.

regions

An array of Vercel Edge Network regions where your app will be deployed.

maxDuration

Maximum execution duration in seconds for serverless functions. Available on Pro and Enterprise plans.

memory

Amount of memory (in MB) allocated to serverless functions.

split

If true, each route will be deployed as a separate function. Useful for large apps to stay within function size limits.
From the implementation:

isr

Incremental Static Regeneration configuration. Only works with serverless functions.
You can also configure ISR per-route:
ISR requires a serverless runtime. It does not work with edge functions.

images

Configuration for Vercel Image Optimization:

Per-route configuration

You can export a config object from +page.server.js or +server.js files to configure individual routes:
From the adapter implementation:

Build output

The adapter generates a .vercel/output directory:
The configuration defines how requests are routed:

Platform object

Vercel provides platform-specific context via event.platform:
Example usage:

Environment variables

Vercel provides several automatic environment variables: Access them in your app:

Deployment

1

Build your app

2

Deploy to Vercel

Skew protection

Vercel automatically enables skew protection to prevent version mismatches:

Cron jobs

Vercel supports scheduled functions via vercel.json:
The adapter validates cron paths against your routes:
Vercel automatically detects VERCEL=true during builds, which is how adapter-auto identifies the Vercel environment.