Package-level declarations

Types

Link copied to clipboard
data class AutoPollConfiguration(var pollingInterval: Duration = 60.seconds, var maxInitWaitTime: Duration = 5.seconds)

Describes the auto polling configuration.

Link copied to clipboard
interface ConfigCache

A cache API used to make custom cache implementations.

Link copied to clipboard
interface ConfigCatClient

ConfigCat SDK client.

Link copied to clipboard

Configuration options for ConfigCatClient.

Link copied to clipboard
class ConfigCatUser(val identifier: String, email: String? = null, country: String? = null, custom: Map<String, String>? = null)

An object containing attributes to properly identify a given user for variation evaluation. Its only mandatory attribute is the identifier.

Link copied to clipboard

Describes the location of your feature flag and setting data within the ConfigCat CDN.

Link copied to clipboard

Additional information about flag evaluation.

Link copied to clipboard

Additional information about flag evaluation.

Link copied to clipboard
class Hooks

Events fired by ConfigCatClient.

Link copied to clipboard
data class LazyLoadConfiguration(var cacheRefreshInterval: Duration = 60.seconds)

Describes the lazy load polling configuration.

Link copied to clipboard
class LocalStorageCache : ConfigCache

ConfigCache implementation that uses localStorage as persistent storage.

Link copied to clipboard
@Serializable
data class PercentageRule(val value: Any, val percentage: Double, val variationId: String? = null)

Describes a percentage rule.

Link copied to clipboard
interface PollingMode

Describes a polling mode configuration.

Link copied to clipboard
@Serializable
data class RolloutRule(val value: Any, val comparisonAttribute: String, val comparator: Int, val comparisonValue: String, val variationId: String? = null)

Describes a targeting rule.

Link copied to clipboard
@Serializable
data class Setting(val value: Any, val type: Int = 0, val percentageItems: List<PercentageRule> = listOf(), val rolloutRules: List<RolloutRule> = listOf(), val variationId: String? = null)

Describes a feature flag / setting.

Link copied to clipboard
class SharedPreferencesCache(context: Context) : ConfigCache

ConfigCache implementation that uses SharedPreferences as persistent storage.

Link copied to clipboard
class TypedEvaluationDetails<T>(val key: String, val variationId: String?, val user: ConfigCatUser?, val isDefaultValue: Boolean, val error: String?, val value: T, val fetchTimeUnixMilliseconds: Long, val matchedEvaluationRule: RolloutRule?, val matchedEvaluationPercentageRule: PercentageRule?) : EvaluationDetailsBase

Additional information about flag evaluation.

Link copied to clipboard
class UserDefaultsCache : ConfigCache

ConfigCache implementation that uses NSUserDefaults as persistent storage.

Functions

Link copied to clipboard

Creates an auto polling configuration.

Link copied to clipboard

Creates a new or gets an already existing ConfigCatClient for the given sdkKey.

Link copied to clipboard
inline suspend fun <T : Any> ConfigCatClient.getValue(key: String, defaultValue: T, user: ConfigCatUser? = null): T

Gets the value of a feature flag or setting as T identified by the given key. In case of any failure, defaultValue will be returned. The user param identifies the caller.

Link copied to clipboard
inline suspend fun <T : Any> ConfigCatClient.getValueDetails(key: String, defaultValue: T, user: ConfigCatUser? = null): TypedEvaluationDetails<T>

Gets the value and evaluation details of a feature flag or setting identified by the given key. The user param identifies the caller.

Link copied to clipboard

Creates a lazy load polling configuration.

Link copied to clipboard

Creates a manual polling configuration.