Skip to main content
The @sveltejs/adapter-auto adapter automatically detects your production environment and selects the appropriate adapter for deployment.

Installation

Usage

Add the adapter to your svelte.config.js:

How it works

When you build your app, adapter-auto detects the environment by checking for specific environment variables and installs the appropriate adapter automatically:
1

Environment detection

Checks for platform-specific environment variables (e.g., VERCEL, CF_PAGES, NETLIFY)
2

Adapter installation

Automatically installs the detected adapter if not already present
3

Build execution

Runs the selected adapter to generate platform-specific output

Supported environments

The adapter automatically detects and supports the following platforms:
Refer to the adapter source code for the complete list:

When to use adapter-auto

Good for: Quick starts, prototyping, and projects that deploy to a single, well-known platform.Not ideal for: Production apps where you want explicit control over deployment configuration or need to customize adapter options.

Replacing adapter-auto

For production deployments, consider replacing adapter-auto with a specific adapter:
When you build with adapter-auto, it will warn you and suggest which adapter to use for your detected environment.

Limitations

Certain features are not available with adapter-auto because it cannot determine environment capabilities:
If your app uses read from $app/server or instrumentation.server.js, you must use a specific adapter instead of adapter-auto.