What is a SvelteKit adapter and how do adapter-static and adapter-node differ?

Tests your grasp of SvelteKit's deployment abstraction. A strong answer outlines how adapters compile the app for a target platform, contrasting adapter-static's CDN-ready HTML with adapter-node's server-side request handler for Node environments.
WHAT THIS TESTS: This question probes whether you understand SvelteKit's build architecture and the separation between framework code and deployment targets. The interviewer wants to see that you know an adapter is not the bundler itself but a post-build transformer that shapes the Vite output for a specific runtime. They also want to hear a clear distinction between static site generation and serverful Node deployment, including the trade-offs in capability and hosting cost.
A GOOD ANSWER COVERS: First, define an adapter as a small plugin configured in svelte.config.js that runs during vite build and turns the framework-agnostic build artifacts into a platform-specific output. Second, explain adapter-static: it pre-renders pages into HTML files at build time, making it ideal for content sites deployed to static hosts like GitHub Pages or Cloudflare Pages; it lacks a running server so API routes and server hooks require prerender configuration or a fallback page. Third, explain adapter-node: it produces a Node server, often with a built-in request handler like a Polka or Express-compatible middleware, enabling dynamic server-side rendering, form actions, and API endpoints on traditional VPS or container platforms. Fourth, mention that the choice depends on whether your app needs dynamic per-request logic or can survive as static files.
COMMON WRONG ANSWERS: A red flag is saying an adapter is a Vite plugin that handles code bundling; bundling is Vite's job, while the adapter only repackages the already-bundled output. Another mistake is claiming adapter-static supports server routes out of the box; without dynamic rendering, those routes fail unless explicitly handled. Conversely, some candidates suggest adapter-node is needed for every SvelteKit app, missing that static export eliminates server overhead for sites that do not need SSR.
LIKELY FOLLOW-UPS: The interviewer may ask how to handle environment variables or secrets when switching between static and server adapters, since static builds bake values in at build time while Node servers can read runtime env. They might also ask about edge adapters like Cloudflare or Vercel, or how to write a custom adapter for an internal platform. You should also be ready to discuss the platform property on RequestEvent, which carries adapter-specific context such as Cloudflare KV bindings.
ONE CONCRETE EXAMPLE: Imagine a marketing blog with no user sessions and a contact form handled by a third-party API. Using adapter-static, you prerender every article into HTML, set fallback to true for the contact page, and deploy to a CDN for near-zero hosting cost. If the same blog later adds user comments stored in a database and requires server-side pagination, you would switch to adapter-node, deploy to a VPS, and implement load functions that query the database on each request.
Source: svelte.dev
Read the original → svelte.dev
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.