SvelteKit 3.1
Last reviewed Oct 25, 2026
Prompt Details
Prompt Composition
5prompts
- JavaScript ES2026102 lines · 3.1K tokens
- TypeScript 6.044 lines · 1.3K tokens
- Svelte 5.5762 lines · 2.2K tokens
- Node.js 24101 lines · 5.3K tokens
- SvelteKit 3.167 lines · 3.2K tokens
Total376 lines · 15.1K tokens
CWE Coverage
- 20
- 22
- 59
- 73
- 78
- 79
- 88
- 89
- 95
- 113
- 117
- 200
- 201
- 203
- 208
- 209
- 214
- 250
- 295
- 297
- 307
- 319
- 323
- 330
- 338
- 346
- 347
- 352
- 354
- 362
- 367
- 377
- 384
- 426
- 444
- 459
- 471
- 488
- 494
- 502
- 524
- 532
- 552
- 601
- 602
- 613
- 614
- 639
- 653
- 732
- 770
- 772
- 807
- 829
- 838
- 862
- 863
- 908
- 915
- 916
- 918
- 922
- 942
- 943
- 1004
- 1021
- 1275
- 1321
- 1333
Prompt Preview
Apply the Svelte 5.57, Node.js 24, TypeScript 6.0, and JavaScript ES2026 prompts first. These rules cover SvelteKit's server and browser boundaries. Apply Node adapter settings only to Node deployments; verify equivalent controls in other adapters.
Configuration and private code
- Put SvelteKit configuration, including
csrf,csp,paths.origin, andexperimental, in thesveltekit(...)Vite plugin invite.config.js. Review the effective production configuration;svelte.config.jsis no longer read. Match Svelte, Vite, the Svelte Vite plugin, TypeScript, and adapter peer requirements to the deployed toolchain. - Keep secrets and privileged helpers in server-only modules:
src/lib/server(importable as#lib/serverwhen the packageimportsalias is configured), anotherserverdirectory outsidesrc/routesandstatic, or a filename with aserversegment. Keep them out of universal loads and components, including indirect imports. Build withTESTunset because that setting disables illegal server-import detection. - Read private values from
$app/env/privatewhen using explicit environment variables, or from the private$envmodules. Reserveenv.publicPrefixfor values safe to ship to the browser; static values are embedded at build time, while dynamic values cannot be used while prerendering. For explicit variables, declare and validate security-sensitive values insrc/env.tswithdefineEnvVarsfrom@sveltejs/kit/env; leave secretspublic: false.
Authentication, authorization, and routing
- Verify session cookies or bearer tokens