Experimentation

Server SDK

Decide a variant on your own server before the page is rendered, with no network call per request and nothing that flickers.

TypeScriptLocal decisionsEdge ready

The server SDK is how a backend takes part in a server-side experiment. It downloads the website's experiment setup and keeps it fresh in the background, so asking which variant a visitor gets is a local function call rather than a request to Pertento. Your server renders the right variant the first time, and if Pertento cannot be reached it falls back to your default experience instead of an error.

It is available for TypeScript and JavaScript as an open-source npm package with no dependencies. It runs on Node, Bun and Deno, and on edge workers such as Cloudflare Workers, Vercel Edge and Deno Deploy, using only fetch and Web Crypto. Backends in other languages get the same decisions and conversions over an authenticated HTTP API.

The decision travels to the page as a small seed in the head, which the SDK writes for you. The Pertento snippet reads it, enrols the visitor in exactly the variants your server chose and counts them, so the browser and the backend agree on who the visitor is. Pertento sets no cookies: your server keeps the visitor ID, or decides on your own customer ID instead.

Access is through server keys, created per website by an Owner or Admin and shown once. A website can hold several at a time, so a key can be rotated without downtime, and creating or revoking one notifies the account. When the website reports conversions from the server, the SDK reports purchases and other conversions too, credited only to the experiments the person was actually shown.

Better experiments, better conversions

Test on all visitors with the world’s lightest script and make confident decisions powered by real-time reporting.Start trialRequest a demo