Skip to main content

Installation

No additional dependencies. The adapter uses structural typing — it does not import from @sveltejs/kit.

Setup

1. Create the client instance

2. Add identity hook

Ensure every visitor has an identity cookie using a server hook:

Request flow

Using createLoad

The createLoad helper auto-extracts visitor identity and context from the SvelteKit event:
Then use the data in your page:

Multiple zones

Lower-level helpers

runOptionsFromEvent(event)

Extract identity and context fields manually:

ensureIdentity(event)

Sets an rlvt_tmpId cookie on the event if no identity cookie exists. Use in hooks or load functions:

Handling JSON responses

Click tracking

Click tracking must always be set up after display. Every content display should have a corresponding click tracking mechanism — either a redirect link or a trackClick() call.
Every RunResult includes redirectionUrl and trackClick(). Two patterns:
See Core SDK — Click tracking for full details.

Compatibility with the client tracker

Add data-rlvt-ssr="true" to your wrapper element. The client-side tracker automatically skips server-rendered zones.