1---
2title: SvelteKit
3description: Package SvelteKit SSR and prerendered assets as a Neon Function Fetch artifact.
4sidebar:
5 order: 5
6---
7
8`Neon.Website.SvelteKit` packages SvelteKit's server handler and assets for a
9Node 24 Fetch entry on Neon Functions. The Node adapter supplies a handler, not a
10listening production server; no container or S3 hosting is provisioned.
11
12## Prepare the app
13
14Start from a compatible SvelteKit app or the
15[runnable SvelteKit example](https://github.com/alchemy-run/alchemy/tree/main/examples/neon-website-sveltekit).
16This integration targets the Kit v3 plugin configuration shape. Configure
17[deployment credentials](/neon/setup), then install in the app directory:
18
19Install [Alchemy and its matching Effect dependencies](/getting-started) first;
20use Node 24 for this build toolchain.
21
22```sh
23pnpm add -D @alchemy.run/frontend-frameworks @vercel/nft
24```
25
26Keep `sveltekit()` in `vite.config.*`, without your own adapter. For Kit v3, use
27plugin configuration or the resource's serializable `kit` overrides rather than
28a `svelte.config.js` file. Alchemy injects the deployment adapter.
29
30## Define the stack
31
32```typescript
33// alchemy.run.ts
34import * as Alchemy from "alchemy";
35import * as Neon from "alchemy/Neon";
36import * as Effect from "effect/Effect";
37
38export default Alchemy.Stack(
39 "NeonSvelteKit",
40 { providers: Neon.providers(), state: Alchemy.localState() },
41 Effect.gen(function* () {
42 const site = yield* Neon.Website.SvelteKit("Web", {
43 rootDir: ".",
44 });
45 return { url: site.url };
46 }),
47);
48```
49
50SvelteKit handles SSR, endpoints, and form actions; prerendered pages and client
51assets are packaged alongside it. Use SvelteKit's `$env/static/private` or
52`$env/dynamic/private` as appropriate for build-time versus runtime values. Public
53environment modules expose values to the browser; never put backend secrets there.
54
55## Develop and deploy
56
57```sh
58pnpm exec alchemy dev
59pnpm exec alchemy deploy
60pnpm exec alchemy destroy
61```
62
63Run each separately, with `destroy` for cleanup. Dev runs the native SvelteKit/Vite
64server with HMR and returns a local URL, without an implicit Neon Project or
65Function. Append `.pipe(Alchemy.remote())` to the Website Effect to opt into live
66deployment during dev.
67
68Without scope, live deploy creates an Ohio Project. Pass either `project` or
69`branch` to reuse a backend; use Ohio when adding storage. See
70[scope and credentials](/neon/frontend/vite#scope-and-credentials), including the
71difference between account keys and branch service tokens.
72
73:::caution[Deployment limits]
74Complete live framework acceptance remains unverified. In Neon probes, updated
75deployment metadata has not guaranteed new code/env at the Function URL. Native
76dev is not a production-runtime test. No CDN or durable framework cache is added,
77and custom-domain registration does not validate TLS. See the
78[shared deployment limits](/neon/frontend/vite#environment-and-deployment-limits).
79:::
80
81## Reference
82
83- [SvelteKit API](/providers/neon/website/sveltekit)
84- [Runnable SvelteKit example](https://github.com/alchemy-run/alchemy/tree/main/examples/neon-website-sveltekit)