getFeatureFlag

abstract fun getFeatureFlag(distinctId: String, key: String, defaultValue: Any? = null, groups: Map<String, String>? = null, personProperties: Map<String, Any?>? = null, groupProperties: Map<String, Map<String, Any?>>? = null): Any?

Returns the feature flags variant if multi-variant, otherwise whether it is enabled or not Docs https://posthog.com/docs/feature-flags and https://posthog.com/docs/experiments

Parameters

distinctId

the distinctId

key

the Key

defaultValue

the default value if not found


open fun getFeatureFlag(distinctId: String, key: String): Any?

Returns the feature flags variant if multi-variant, otherwise whether it is enabled or not Docs https://posthog.com/docs/feature-flags and https://posthog.com/docs/experiments

Return

the feature flag value or null if not found

Parameters

distinctId

the distinctId

key

the Key


open fun getFeatureFlag(distinctId: String, key: String, options: PostHogFeatureFlagOptions): Any?

Returns the feature flags variant if multi-variant, otherwise whether it is enabled or not Docs https://posthog.com/docs/feature-flags and https://posthog.com/docs/experiments

Parameters

distinctId

the distinctId

key

the Key

options

the feature flag options containing defaultValue, groups, personProperties, and groupProperties


open fun getFeatureFlag(distinctId: String, key: String, defaultValue: Any?): Any?

Returns if a feature flag is enabled, the feature flag must be a Boolean Docs https://posthog.com/docs/feature-flags and https://posthog.com/docs/experiments

Parameters

distinctId

the distinctId

key

the Key

defaultValue

the default value if not found