How the Svelte SDK works

Developer preview

This feature is in developer preview. Use with caution as it may change unexpectedly. For more information, contact us.

A page request passes through the catch-all route, the project map, the composition renderer, and your component map:

  1. A visitor requests a page. SvelteKit's catch-all route [...path]/+page.server.ts receives the request.

  2. The composition is fetched server-side. createUniformLoad from @uniformdev/canvas-sveltekit uses RouteClient to resolve the URL against the Project Map and fetch the full composition data.

  3. Components render via the composition tree. UniformComposition walks the tree and uses your componentMap (or a custom resolveRenderer) to map each Uniform component type to a Svelte component. Parameters are flattened and passed directly as props.

  4. Personalization and testing are evaluated. The UniformContext provider evaluates personalization rules and A/B tests either client-side (standard) or outputs NESI placeholders for edge evaluation (edge).

  5. Visual editing works out of the box. When previewing in the Uniform dashboard, the SDK automatically enables contextual editing, inline text editing, and live preview via the playground route.