--- title: "Svelte" description: "Add Pulse analytics to Svelte or SvelteKit. Simple setup for both Vite-based Svelte and SvelteKit applications." category: "framework" brandColor: "#FF3E00" officialUrl: "https://svelte.dev" relatedIds: ["astro", "vue"] date: "2026-03-28" --- Add the script to your `index.html` for Vite-based Svelte, or use `` in SvelteKit. --- ## Method 1: Svelte (Vite) For standard Svelte projects using Vite, add the Pulse script to your `index.html`. ```html filename="index.html" My Svelte App
``` ## Method 2: SvelteKit In SvelteKit, use `` in your root layout to add the script to every page. ```svelte filename="src/routes/+layout.svelte" ``` Alternatively, you can add the script directly to `src/app.html` in your SvelteKit project.