041Guide[2026-10-02]
1 min · Experimentation, Frontend architecture · Updated [DATE]

[Sample] Migrating A/B tests to Statsig without pausing experiments

Sticky bucketing, server-side reads, and running both tools in parallel.

[Body copy. Serif at 20px on a 680px measure. Headings inside articles switch back to Geist. Links in prose, like this one, get the highlighter on hover.]

Read the variant on the server

getVariant.ts
// sample · resolve once per request so the page never flashes control
const exp = await statsig.getExperiment(user, 'pdp_gallery')
const layout = exp.get('layout', 'control')
Fig. 2 · Interactive: drag the traffic split; bucket assignment stays stable per user. Static diagram without JS.
Line changes · [date]: clarified sticky bucketing[date]: published