-
Notifications
You must be signed in to change notification settings - Fork 10
Description
/// <summary>
/// The set of person properties that are known. Used to compute flags locally, if
/// <see cref="PostHogOptions.PersonalApiKey"/> is present and <see cref="OnlyEvaluateLocally"/> is <c>true</c>.
/// If evaluating a feature flag remotely, this is not required. It can be used to override person properties
/// on PostHog's servers when evaluating feature flags.
/// </summary>
public Dictionary<string, object?>? PersonProperties { get; init; }
You mentioned that "If evaluating a feature flag remotely, this is not required", which is not true.
Assume that we have feature flag named FF1 with release condition [email == "mymail@mail.com"].
Code, where PersonProperties is not specified, feature flag FF1 will evaluated to false
var allFlags = await posthog.GetAllFeatureFlagsAsync("userABC", new AllFeatureFlagsOptions
{
PersonProperties = null,
})
Code, where PersonProperties are specified, feature flag FF1 will evaluated to true (because release conditions where succeeded)
var allFlags = await posthog.GetAllFeatureFlagsAsync("userABC", new AllFeatureFlagsOptions
{
PersonProperties = new Dictionary<string, object?> { { "email", "mymail@mail.com" } },
})
That means that If evaluating a feature flag remotely, this is required to get correct evaluation results.