Skip to main content
Before you can deploy your SvelteKit app, you need to adapt it for your deployment target. Adapters are small plugins that take the built app as input and generate output for deployment.

Official adapters

SvelteKit provides official adapters for a variety of platforms:

Using adapters

Your adapter is specified in svelte.config.js:
/// file: svelte.config.js
import adapter from '@sveltejs/adapter-auto';

/** @type {import('@sveltejs/kit').Config} */
const config = {
  kit: {
    adapter: adapter({
      // adapter options go here
    })
  }
};

export default config;

Platform-specific context

Some adapters may have access to additional information about the request. For example, Cloudflare Workers can access an env object containing KV namespaces and other bindings. This information is passed to the RequestEvent used in hooks (see advanced/hooks) and server routes as the platform property:
/// file: src/hooks.server.js
/** @type {import('@sveltejs/kit').Handle} */
export async function handle({ event, resolve }) {
  // Access platform-specific context
  const { platform } = event;
  
  // For example, on Cloudflare:
  // const value = await platform.env.MY_KV_NAMESPACE.get('key');
  
  return resolve(event);
}
Consult each adapter’s documentation to learn what platform-specific context is available.

Adapter capabilities

Different adapters support different features:
FeatureDescription
Server-side renderingDynamic rendering of pages on each request
PrerenderingStatic HTML generation at build time
Edge functionsCode running at the edge, closer to users
StreamingStreaming responses for better performance
Read APIAccess to static assets via read from $app/server

Community adapters

In addition to the official adapters, the community has created adapters for other platforms. You can find community adapters on npm by searching for “sveltekit-adapter”.

Creating custom adapters

If you need to deploy to a platform without an existing adapter, you can create your own. Adapters implement the Adapter interface from @sveltejs/kit:
interface Adapter {
  name: string;
  adapt(builder: Builder): Promise<void> | void;
  emulate?(): AdapterEmulation;
  supports?: {
    read?: (details: { config: any; route: RouteDefinition }) => boolean;
    instrumentation?: () => boolean;
  };
}
Refer to the source code of official adapters for examples of how to implement custom adapters.