Getting Started
Installation
Add ogygia to a SvelteKit app, wire up the Vite plugin, and render your first island.
On this page
ogygia is an islands runtime and docs kit for SvelteKit. It renders your pages on the server as plain HTML, then wakes only the interactive parts on the client. This page walks you from an empty project to a running island in about five minutes.
Prerequisites
ogygia builds directly on SvelteKit and Vite, so the requirements are the same versions those projects support today. If your app already runs on a recent Kit release, you are ready.
| Requirement | Minimum | Recommended | Notes |
|---|---|---|---|
| Node.js | 18.13 | 20 LTS or newer | Needed for the Vite 5 toolchain. |
| SvelteKit | 2.0 | latest 2.x | ogygia hooks into Kit’s SSR pipeline. |
| Svelte | 5.0 | latest 5.x | Runes mode is required. |
| Vite | 5.0 | latest 5.x | The plugin runs as a Vite transform. |
| Package manager | any | pnpm | Workspaces are well supported. |
Runes only. ogygia targets Svelte 5 in runes mode. Legacy reactive statements (
$:) are not supported inside islands. If you are migrating an older app, convert your interactive components to$stateand$derivedfirst.
Install the package
Add ogygia with your package manager of choice. The runtime, the Vite plugin, and the docs kit all ship in a single package.
npm install ogygiapnpm add ogygiayarn add ogygiabun add ogygiaThere are no peer packages to install by hand. ogygia declares SvelteKit and Svelte as peers and will warn if the installed versions fall outside the supported range.
Add the Vite plugin
The plugin is what turns an ordinary import into an island. It rewrites imports that carry a wake hint, splits each island into its own client chunk, and leaves everything else as server-only HTML. Register it before the SvelteKit plugin in your config.
// vite.config.ts
import { sveltekit } from '@sveltejs/kit/vite';
import { ogygia } from 'ogygia/vite';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [
ogygia({
// Directory that holds your content collections.
content: 'src/content',
// Wake strategy used when an import omits an explicit hint.
defaultWake: 'visible'
}),
sveltekit()
]
});The order matters. ogygia needs to see the raw module graph before Kit’s own transforms run, so it must sit earlier in the array.
Enable Markdown
ogygia reads .svx files as Svelte-flavored Markdown. Point the preprocessor at your file extensions in svelte.config.js so Kit knows how to compile them.
// svelte.config.js
import adapter from '@sveltejs/adapter-auto';
import { markdown } from 'ogygia/markdown';
import { vitePreprocess } from '@sveltejs/kit/vite';
export default {
extensions: ['.svelte', '.svx'],
preprocess: [vitePreprocess(), markdown()],
kit: {
adapter: adapter()
}
};With this in place, any .svx file becomes a normal Svelte component. Frontmatter is parsed into metadata, headings feed the on-this-page rail, and fenced code blocks are highlighted at build time.
Your first page
Create a content file and give it frontmatter. The body starts at a level-two heading; the title comes from the frontmatter, not from an # H1.
---
title: Hello islands
summary: The smallest possible ogygia page.
---
Everything on this page is static HTML until an island wakes up.
## A live counter
<script>
import Counter from '$lib/playground/demos/Counter.svelte' with { wake: 'visible' };
</script>
<Counter />Start your dev server and open the page. The prose renders instantly from the server. When the counter scrolls into view, its chunk loads and it comes alive.
pnpm devNext steps
- Read the quick start to build a real content collection and route.
- Learn how islands wake in islands.
- Explore the full render model in regions.
Tip. If an island never wakes, check that its import carries a
with { wake: '...' }attribute. Without a wake hint the plugin treats the component as server-only and ships no client chunk for it.