Installation
Setup
1. Create the client instance
Create a shared client instance in a server-only module:2. Add identity middleware
Createmiddleware.ts at the root of your project:
rlvt_tmpId cookie before any personalised content is requested.
Request flow
Using ReelevantZone (recommended)
TheReelevantZone is an async React Server Component that fetches and renders personalised content:
ZoneProps
Custom rendering with JSON
For headless personalisation where you want to build your own UI:Manual usage (without ReelevantZone)
If you prefer direct control:Multiple zones on a page
Fetch multiple zones in parallel for optimal performance:Each
ReelevantZone is an independent async component that fetches in parallel when rendered at the same level. You don’t need to use runAll explicitly with components — Next.js handles the parallel fetching automatically.Click tracking
EveryRunResult includes redirectionUrl and trackClick(). Two patterns:
Redirect link
UseredirectionUrl directly as an <a href>:
Server-side fire-and-forget
Callresult.trackClick() from a Server Action — it records the click and swallows all errors:
Compatibility with the client tracker
The SDK addsdata-rlvt-ssr="true" to rendered elements. The client-side Reelevant tracker automatically skips zones with this attribute, so there is no double-loading or flickering.
You can still use the client tracker on the same page for:
- Event tracking (clicks, impressions, conversions)
- Client-only zones (consent-dependent content, overlays)
- On-site integrations (datalayer triggers, URL rules)