experiment.
Available context fields
The following fields are available in the page template when an experiment is active:
When no experiment is active,
experiment is null (or not present). Always null-check before using.
experiment.config structure
experiment.config is a key/value map where each key is a parameter name and each value is an object with a value property:
config. Experiment Center merges the baseline parameters with the variation’s overrides before injection, so you never need to look up the default yourself.
Read a parameter in a template
Auth0 Universal Login page templates use EJS. The examples below use EJS syntax. EJS syntax:Customize signup and login with Partials
When you customize Signup and Login prompts using partials, the experiment context is passed explicitly as part of your partial. In the partial, the sameexperiment variable is available:
Example: signup headline copy variant
This example shows a feature flag with a string parameter that controls the signup page headline. The control variation uses “Create your account”; the treatment uses “Join in seconds.” Feature flag parameters:signup_headline: "Create your account")
Treatment variation:
Example: conditional UI element
This example uses a boolean parameter to show or hide an additional UI element:=== true comparison (rather than a truthy check) prevents the element from appearing when experiment is null or when the parameter is absent.
Safe defaults when no experiment is active
When no experiment is active,experiment is null in the template context. Structure your templates to always render correctly without experiment context: