documentation/docs/25-build-and-deploy/20-adapters.md
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 exist for a variety of platforms — these are documented on the following pages:
@sveltejs/adapter-cloudflare for Cloudflare Workers and Cloudflare Pages@sveltejs/adapter-netlify for Netlify@sveltejs/adapter-node for Node servers@sveltejs/adapter-static for static site generation (SSG)@sveltejs/adapter-vercel for VercelAdditional community-provided adapters exist for other platforms.
Your adapter is specified in svelte.config.js:
/// file: svelte.config.js
// @filename: ambient.d.ts
declare module 'svelte-adapter-foo' {
const adapter: (opts: any) => import('@sveltejs/kit').Adapter;
export default adapter;
}
// @filename: index.js
// ---cut---
import adapter from 'svelte-adapter-foo';
/** @type {import('@sveltejs/kit').Config} */
const config = {
kit: {
adapter: adapter({
// adapter options go here
})
}
};
export default config;
Some adapters may have access to additional information about the request. For example, Cloudflare Workers can access an env object containing KV namespaces etc. This can be passed to the RequestEvent used in hooks and server routes as the platform property — consult each adapter's documentation to learn more.