SvelteKit llms.txt · AI Docs Browser · mdream

[llms.txt Tools](https://mdream.dev/llms-txt/sveltekit/llms-txt)

# SvelteKit llms.txt

Browse SvelteKit documentation as markdown. Click any page in the sidebar to view it, or copy the full llms.txt for your AI tools.

svelte.dev/llms.txt

[Raw llms.txt](https://svelte.dev/docs/kit/llms.txt) [Raw llms-full.txt](https://svelte.dev/llms-full.txt)

Copy Markdown [](https://svelte.dev/llms.txt)

llms.txt

Before we begin

What is SvelteKit?

What is Svelte?

SvelteKit vs Svelte

Svelte

Editor setup

Default rendering

Static site generation

Single-page app

Multi-page app

Separate backend

Serverless app

Your own server

Container

Library

Offline app

Mobile app

Desktop app

Browser extension

Embedded device

Project files

svelte-package

param matchers

routes

hooks

hooks

service worker

observability

Other files

Fetch APIs

FormData

Stream APIs

URL APIs

Web Crypto

+page

+error

+layout

+server

$types

Other files

Further reading

Tutorial: Routing

Tutorial: API routes

Docs: Advanced routing

Page data

Layout data

page.data

Universal vs server

Using URL data

Making fetch requests

filterSerializedResponseHeaders

Cookies

Headers

Using parent data

Errors

Redirects

Streaming with promises

Parallel loading

Rerunning load functions

invalidate(url)

invalidateAll()

Implications for authentication

(When do load functions rerun?)

hooks

Using getRequestEvent

Further reading

Tutorial: Loading data

Tutorial: Errors and redirects

Tutorial: Advanced loading

Default actions

Named actions

Anatomy of an action

Loading data

Progressive enhancement

applyAction

reset focus

Alternatives

GET vs POST

Further reading

Tutorial: Forms

prerender

entries

entries

ssr

csr

progressively enhanced

trailingSlash

config

Further reading

Tutorial: Page options

Avoid shared state on the server

No side-effects in load

Using state and stores with context

Component and page state is preserved

Storing state in the URL

Storing ephemeral state in snapshots

Overview

query

query.batch

query.live

form

command

Single-flight mutations

prerender

Handling validation errors

Using getRequestEvent

Redirects

$env/static/private

$env/static/public

$env/dynamic/private

$env/dynamic/public

Explicit environment variables

$app/env/private

$app/env/public

During the build

Preview your app

@sveltejs/adapter-cloudflare

@sveltejs/adapter-netlify

@sveltejs/adapter-node

@sveltejs/adapter-static

@sveltejs/adapter-vercel

Using adapters

Platform-specific context

Cloudflare Pages

Netlify

Vercel

Azure Static Web Apps

AWS via SST

Google Cloud Run

Environment-specific configuration

Adding community adapters

Usage

Deploying

Environment variables

Options

Graceful shutdown

IDLE_TIMEOUT

Socket activation

Custom server

Usage

Zero-config support

Vercel

Options

GitHub Pages

Usage

Prerendering individual pages

Apache

Comparisons

Usage

Options

Cloudflare Workers

Cloudflare Pages

Runtime APIs

Headers and redirects

Troubleshooting

Migrating from Workers Sites

Usage

Options

Basic Configuration

Runtime APIs

Troubleshooting

Usage

Netlify Edge Functions

Netlify alternatives to SvelteKit functionality

Troubleshooting

Usage

Deployment configuration

edge network regions

increased

maximum execution duration

Image Optimization

Incremental Static Regeneration

Environment variables

Skew protection

Notes

Troubleshooting

Rest parameters

Optional parameters

Matching

Sorting

matchers

Encoding

Advanced layouts

Further reading

Tutorial: Advanced Routing

Server hooks

Shared hooks

Universal hooks

Further reading

Tutorial: Hooks

Error objects

Expected errors

Unexpected errors

Rendering errors

Responses

Type safety

Further reading

Tutorial: Errors and redirects

Tutorial: Hooks

data-sveltekit-preload-data

data-sveltekit-preload-code

data-sveltekit-reload

data-sveltekit-replacestate

data-sveltekit-keepfocus

data-sveltekit-noscroll

Disabling options

Inside the service worker

Manual registration

Updating the service worker

Other solutions

References

Private environment variables

Server-only utilities

Your modules

How it works

Further reading

Tutorial: Environment variables

API

Loading data for a route

Caveats

sequence

load

Form actions

Remote functions

Augmenting the built-in tracing

Development quickstart

@opentelemetry/api

disable generation

Anatomy of a package.json

TypeScript

Best practices

Source maps

Options

Publishing

Caveats

Sessions vs tokens

Integration points

Libraries

Guides

Diagnosing issues

Performance

Performance

Performance

enhancing the performance of your webpage

Optimizing assets

Handbrake

lazy-load videos

FFmpeg

Reducing code size

Navigation

web fonts

single page app (SPA) mode

server load functions

Hosting

Further reading

CSS

Svelte

Vite's built-in handling

@sveltejs/enhanced-img

Loading images dynamically from a CDN

Best practices

largest contentful paint (LCP)

cumulative layout shift (CLS)

Route announcements

Focus management

The "lang" attribute

Further reading

MDN Web Docs: Accessibility

The A11y Project

How to Meet WCAG (Quick Reference)

Out of the box

Manual setup

Other resources

What can I make with SvelteKit?

How do I include details from package.json in my application?

How do I fix the error I'm getting trying to include a package?

svelte-package

How do I use the view transitions API?

How do I set up a database?

How do I use a client-side library accessing document or window?

How do I use a different backend API server?

How do I use middleware?

How do I use Yarn?

vitePreprocess

Add-ons

Packages

Additional integrations

Vite plugins

Integration FAQs

Visual Studio Code

Other Editors

WebStorm Svelte: Debug Your Application

Debugging JavaScript Frameworks in Neovim

Google Chrome and Microsoft Edge Developer Tools

References

Debugging Node.js

redirect and error are no longer thrown by you

path is required when setting cookies

Top-level promises are no longer awaited

goto(...) changes

paths are now relative by default

Server fetches are not trackable anymore

preloadCode arguments must be prefixed with base

resolvePath has been removed

Improved error handling

Dynamic environment variables cannot be used during prerendering

form and data have been removed from use:enhance callbacks

Forms containing file inputs must use multipart/form-data

Generated tsconfig.json is more strict

getRequest no longer throws errors

vitePreprocess is no longer exported from @sveltejs/kit/vite

Updated dependency requirements

SvelteKit 2.12: $app/stores deprecated

package.json

adapter

adapter

Project files

Pages and layouts

Endpoints

Integrations

FAQs

Examples

sveltejs/realworld

A HackerNews clone

svelte.dev

Support

CSR

Edge

Hybrid app

Hydration

ISR

MPA

Prerendering

PWA

Routing

SPA

SSG

SSR

Server

VERSION

error

fail

invalid

isActionFailure

isHttpError

isRedirect

isValidationError

json

normalizeUrl

redirect

text

Action

ActionFailure

ActionResult

Actions

Adapter

AfterNavigate

AwaitedActions

BeforeNavigate

Builder

ClientInit

Config

Cookies

here

here

here

here

here

Emulator

EnvVarConfig

server-only module

Handle

HandleClientError

HandleFetch

HandleServerError

HandleValidationError

HttpError

InvalidField

KitConfig

LessThan

LiveQueryRequestedResult

LiveRequestedEntry

Load

LoadEvent

filterSerializedResponseHeaders

LoadProperties

Navigation

NavigationBase

NavigationEnter

NavigationEvent

NavigationExternal

NavigationFormSubmit

NavigationGoto

NavigationLeave

NavigationLink

NavigationPopState

NavigationTarget

NavigationType

NumericRange

OnNavigate

Page

ParamMatcher

PrerenderOption

QueryRequestedResult

Redirect

RemoteCommand

RemoteForm

RemoteFormEnhanceCallback

RemoteFormEnhanceInstance

RemoteFormField

RemoteFormFieldType

RemoteFormFieldValue

RemoteFormFields

RemoteFormInput

RemoteFormIssue

RemoteLiveQuery

RemoteLiveQueryFunction

RemotePrerenderFunction

RemoteQuery

RemoteQueryFunction

RemoteQueryOverride

RemoteQueryUpdate

RemoteResource

RequestEvent

filterSerializedResponseHeaders

RequestHandler

RequestedEntry

RequestedResult

Reroute

ResolveOptions

RouteDefinition

SSRManifest

ServerInit

ServerInitOptions

ServerLoad

ServerLoadEvent

Snapshot

SubmitFunction

Transport

Transporter

ValidationError

Private types

AdapterEntry

Csp

CspDirectives

DeepPartial

HasNonOptionalBoolean

HttpMethod

IsAny

Logger

MaybePromise

PrerenderEntryGeneratorMismatchHandler

PrerenderEntryGeneratorMismatchHandlerValue

PrerenderHttpErrorHandler

PrerenderHttpErrorHandlerValue

PrerenderInvalidUrlHandler

PrerenderInvalidUrlHandlerValue

PrerenderMap

PrerenderMissingIdHandler

PrerenderMissingIdHandlerValue

PrerenderOption

PrerenderUnseenRoutesHandler

PrerenderUnseenRoutesHandlerValue

Prerendered

RequestOptions

RouteSegment

TrailingSlash

defineEnvVars

sequence

installPolyfills

createReadableStream

getRequest

setResponse

sveltekit

browser

building

dev

version

browser

building

dev

version

applyAction

deserialize

enhance

afterNavigate

beforeNavigate

disableScrollHandling

goto

invalidate

invalidateAll

onNavigate

preloadCode

preloadData

pushState

refreshAll

replaceState

asset

assets

base

match

resolve

resolveRoute

command

form

getRequestEvent

prerender

query

read

requested

query

navigating

page

loading data

form actions

shallow routing

updated

getStores

navigating

page

updated

Asset

RouteId

Pathname

ResolvedPathname

RouteParams

LayoutParams

config.kit.env.privatePrefix

config.kit.env.publicPrefix

config.kit.env.privatePrefix

config.kit.env.publicPrefix

base

build

files

prerendered

version

Config

KitConfig

adapter

alias

appDir

csp

csrf

embedded

env

experimental

files

monorepos

monorepos

monorepos

monorepos

monorepos

monorepos

monorepos

monorepos

monorepos

monorepos

monorepos

monorepos

inlineStyleThreshold

moduleExtensions

outDir

output

paths

prerender

router

serviceWorker

typescript

version

svelte-kit sync

Generated types

$lib

app.d.ts

Error

Locals

PageData

PageState

Platform

## What is SvelteKit's llms.txt?

SvelteKit publishes an `/llms.txt` file that provides AI systems with a structured index of its documentation. It follows the [llms.txt specification](https://llmstxt.org), organizing links to guides, API references, and tutorials under section headings so that LLMs like ChatGPT, Claude, and Gemini can quickly understand what SvelteKit offers and where to find details.

Issues

Spec

469

Sections

109

Links

573.7 KB

Size

~146.6k

Tokens

Sections: Before we begin · What is SvelteKit? · What is Svelte? · SvelteKit vs Svelte · Editor setup · Default rendering · and 463 more

## Add SvelteKit Docs to Your AI Assistant

Select your tool to see how to add SvelteKit's llms.txt as a documentation source.

Cursor

 Windsurf

 Claude Code

 ChatGPT

 Zed

 Copilot

1. 1

   Open any chat or composer panel
2. 2

   Type @Docs and select "Add new doc"
3. 3

   Paste the URL: https://svelte.dev/llms.txt
4. 4

   Wait for the green dot (indexing complete)
5. 5

   Reference @Docs in chat when asking about SvelteKit

Cursor crawls the URL and indexes all subpages. Add a trailing slash to index child pages too.

## Spec Compliance 184 errors

## Frequently Asked Questions

Where is SvelteKit's llms.txt file?

SvelteKit publishes its llms.txt at https://svelte.dev/llms.txt. This file provides a structured, markdown-formatted index of SvelteKit's documentation that AI systems can consume to understand the project's APIs, guides, and references.

How do I use SvelteKit's llms.txt with AI coding assistants?

Copy the llms.txt content and paste it into your AI assistant (Cursor, Windsurf, Claude, ChatGPT) as context. This gives the AI an accurate map of SvelteKit's documentation so it can provide better code suggestions and answers about SvelteKit.

What does SvelteKit's llms.txt contain?

SvelteKit's llms.txt contains 469 sections and 109 documentation links in 573.7 KB (~146.6k tokens). Key sections include Before we begin, What is SvelteKit?, What is Svelte?, SvelteKit vs Svelte, Editor setup, Default rendering.

How many tokens does SvelteKit's llms.txt use?

The concise llms.txt index is approximately 146.6k tokens (573.7 KB). Most AI assistants can fit this within their context window. For the full expanded documentation, look for an llms-full.txt variant which embeds all content inline.

What is SvelteKit?

Web development, streamlined. SvelteKit's llms.txt file helps AI systems understand this by providing a structured overview of its documentation, making it easier for developers to get accurate AI-assisted help when working with SvelteKit.

Can I generate an llms.txt for my own project?

Yes. Use the free llms.txt generator at mdream.dev/tools/llms-txt/generator to crawl your site and produce a spec-compliant llms.txt file. You can also validate existing files with the llms.txt validator.

## Browse More llms.txt Files

[SolidJS Simple and performant reactivity for building user interfaces](https://mdream.dev/llms-txt/sveltekit/llms-txt/solidjs) [Svelte Cybernetically enhanced web apps](https://mdream.dev/llms-txt/sveltekit/llms-txt/svelte) [Analog The fullstack Angular meta-framework](https://mdream.dev/llms-txt/sveltekit/llms-txt/analog) [Next.js The React Framework for the Web](https://mdream.dev/llms-txt/sveltekit/llms-txt/nextjs) [Waku The minimal React framework](https://mdream.dev/llms-txt/sveltekit/llms-txt/waku) [Nuxt The Intuitive Vue Framework](https://mdream.dev/llms-txt/sveltekit/llms-txt/nuxt) [Elysia Ergonomic framework for Humans](https://mdream.dev/llms-txt/sveltekit/llms-txt/elysia) [Vue.js The Progressive JavaScript Framework](https://mdream.dev/llms-txt/sveltekit/llms-txt/vue)

[View all 99 projects ](https://mdream.dev/llms-txt/sveltekit/llms-txt)

## Related Tools

[<h3>llms.txt Generator</h3>Generate an llms.txt for your own project.](https://mdream.dev/llms-txt/sveltekit/tools/llms-txt/generator) [<h3>llms.txt Validator</h3>Validate your llms.txt against the official spec.](https://mdream.dev/llms-txt/sveltekit/tools/llms-txt/validator)

© 2026 [Harlan Wilton](https://github.com/harlan-zw) · [MIT](https://github.com/harlan-zw/mdream/blob/main/license)

[GitHub](https://github.com/harlan-zw/mdream) [Discord](https://discord.com/invite/275MBUBvgP)