SvelteKit Adapter Overview
SvelteKit Adapter Overview
The @capyseo/adapter-sveltekit package provides deep integration with SvelteKit for real-time SEO analysis.
Installation
Integration Methods
| Method | Description | Use Case |
|---|---|---|
| Vite Plugin | Build-time analysis | CI/CD, dev feedback |
| Server Hooks | Runtime analysis | Production monitoring |
Quick Start
Option 1: Vite Plugin
Add to vite.config.ts:
Option 2: Server Hooks
Add to src/hooks.server.ts:
Option 3: Both
Use both for maximum coverage:
- Plugin: Build-time enforcement
- Hooks: Runtime monitoring
Features
Vite Plugin
- Dev server middleware
- Build-time validation
- Minimum score enforcement
- Non-blocking analysis
Server Hooks
- Request/response interception
- Custom report handlers
- Runtime analysis
- Production monitoring
Configuration
Both integrations accept:
| Option | Type | Default | Description |
|---|---|---|---|
enabled |
boolean | true in dev | Enable analysis |
geminiApiKey |
string | env var | AI API key |
exclude |
string[] | - | Paths to skip |
Output Example
Peer Dependencies
@sveltejs/kit^2.0.0svelte^4.0.0 || ^5.0.0vite^5.0.0 || ^6.0.0