ff4k

suspend fun ff4k(featureStore: FeatureStore = InMemoryFeatureStore(), propertyStore: PropertyStore = InMemoryPropertyStore(), source: FF4k.Source = FF4k.Source.KotlinApi, autoCreate: Boolean = false, block: suspend FF4kBuilder.() -> Unit): FF4k(source)

Creates and configures an FF4k instance using the Kotlin DSL.

This function is the primary entry point for the FF4k Kotlin DSL. It initializes an FF4k engine, executes the provided DSL block, and returns the fully configured instance.

Minimal example

val ff4k = ff4k { }

Feature definition example

val ff4k = ff4k {
features {
feature("dark-mode") {
isEnabled = true
description = "Enable dark UI"
}
}
}

Custom stores

val ff4k = ff4k(
featureStore = customFeatureStore,
propertyStore = customPropertyStore
) {
// DSL configuration
}

Return

a fully configured FF4k instance

Parameters

featureStore

the FeatureStore implementation used to persist features

propertyStore

the PropertyStore implementation used to persist properties

source

the source identifier associated with created entities

autoCreate

whether missing features or properties should be auto-created

block

DSL block used to configure the FF4k instance