getFeatureFlagResult

abstract fun getFeatureFlagResult(distinctId: String, key: String, groups: Map<String, String>? = null, personProperties: Map<String, Any?>? = null, groupProperties: Map<String, Map<String, Any?>>? = null, sendFeatureFlagEvent: Boolean? = null): FeatureFlagResult?

Returns the feature flag result containing both value and payload. Docs https://posthog.com/docs/feature-flags and https://posthog.com/docs/experiments

Return

FeatureFlagResult if the flag exists, null otherwise

Parameters

distinctId

the distinctId

key

the Key

groups

groups for group-based flags

personProperties

person properties for flag evaluation

groupProperties

group properties for flag evaluation

sendFeatureFlagEvent

whether to send the $feature_flag_called event, or null to use config default


open fun getFeatureFlagResult(distinctId: String, key: String): FeatureFlagResult?

Returns the feature flag result containing both value and payload. Docs https://posthog.com/docs/feature-flags and https://posthog.com/docs/experiments

Return

FeatureFlagResult if the flag exists, null otherwise

Parameters

distinctId

the distinctId

key

the Key


open fun getFeatureFlagResult(distinctId: String, key: String, options: PostHogFeatureFlagResultOptions): FeatureFlagResult?

Returns the feature flag result containing both value and payload. Docs https://posthog.com/docs/feature-flags and https://posthog.com/docs/experiments

Return

FeatureFlagResult if the flag exists, null otherwise

Parameters

distinctId

the distinctId

key

the Key

options

the feature flag result options containing groups, personProperties, groupProperties, and sendFeatureFlagEvent