Skip to main content

Define First Flag

Declare one namespace-owned typed feature with a default value.

Prerequisites: You have completed Install.

Feature declarations are represented by Namespace, Feature, and FlagDefinition types.

import io.amichne.konditional.context.Context
import io.amichne.konditional.core.Namespace

enum class CheckoutVariant { CLASSIC, SMART }

object AppFeatures : Namespace("app") {
val checkoutVariant by enum<CheckoutVariant, Context>(default = CheckoutVariant.CLASSIC)
}

Namespace declarations define the compile-time schema used by boundary codecs and runtime snapshot loaders.

Verify

val featureKey = AppFeatures.checkoutVariant.key
check(featureKey == "checkoutVariant")

Expected Outcome

After this step, a typed feature declaration compiles and is accessible through your namespace object.

Next Steps

Claim Coverage

Claim IDStatement
CLM-PR01-08AFeature declarations are represented by Namespace, Feature, and FlagDefinition types.
CLM-PR01-08BNamespaces provide a compiled schema used by boundary codecs and loaders.