Skip to main content
The experiments module assigns users to variants using a deterministic hash. No server call is needed — assignment is instant, works offline, and the same user always gets the same variant.

Get Variant

Returns the variant string or null if the experiment is not found, not running, or the user is not in the target audience.
Always handle the null / default case. Experiments can be archived or stopped at any time from the Console.

Module Access

Module Methods

Exposure Tracking

Automatic (Default)

The SDK tracks an experiment_exposure event once per session the first time getVariant() is called for a given experiment.

Manual

Disable automatic tracking and track when the UI is actually visible:

Listen for Assignment Changes

Assignment changes are rare. They occur only when the experiment definition changes on the server, not on every session start.

Experiment Lifecycle

Full Example

Experiments are created in the Console under Experiments. The SDK uses MurmurHash3 for deterministic assignment — the same user always gets the same variant across sessions, platforms, and offline.