Frameworks and SPAs
Pertento for SvelteKit
The tag belongs in the app template so it is server-rendered, and assignment carries across SvelteKit’s client-side routing.
One script tag · 0.9 KB loader · no cookiesAll integrations
SvelteKit renders on the server and hydrates in the browser, so the tag belongs in the application template that produces the head, not in a component that runs after hydration. Placed there it is in the HTML the visitor first receives, which is what anti-flicker rendering needs. After hydration, variants persist as the router moves between routes, and the SDK covers anything a load function settles before the page is built.
How it connects
- Add the tag to the app template head, above the hydration bundle.
- Use the SDK inside load functions for decisions made before render.
- Let assignment persist across client-side navigation.
More in Frameworks and SPAs
All integrationsNext.jsRender the tag in the root layout so it loads before hydration, and variants persist across client-side route changes.How it connectsNuxtOne entry in the app head configuration covers every route, and it lands in the server-rendered HTML rather than after hydration.How it connectsReactA single-page app needs the tag once, in the HTML shell. Variants survive routing rather than being reapplied per view.How it connects