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 · 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 integrations