When utilizing the checkGate
function within Statsig, it is imperative to provide a userID
. This identifier is crucial as it ensures a consistent experience for each user. The userID
is a mandatory field, as it is utilized to maintain uniformity in user experiences and is essential for the randomization process during partial rollouts.
It is important to note that even if an email
is provided as a top-level field on StatsigUser, it does not substitute the requirement for a userID
. In instances where there is no logged-in user, a stable identifier should be established, which could be stored as a cookie or in local storage, and used consistently with each call to Statsig.
This practice is vital for the system to function correctly and provide reliable results.