cadabra-core / com.fo2rist.cadabra / Cadabra
Cadabra
interface Cadabra
Cadabra A/B experiments.
To use:
- create an experiment enum implementing Variant interface
- create Resolver or use one of the predefined to define which variant ot use for particular user/session.
- register and start experiments via Cadabra.config
- when it’s time to apply experimental parameters get the variant via Cadabra.instance’s getExperimentVariant
Experiment registration & start: When experiment is registered via CadabraConfig.registerExperiment it become discoverable by name and waiting to be started. For such experiment getExperimentVariant can not be used yet. To start registered experiments use CadabraConfig.startExperiments. You can register multiple experiments and then start as many as needed with a single CadabraConfig.startExperiments call. Or use CadabraConfig.startExperiment to register and start experiment at the same time.
Functions
getExperimentVariant | Get experiment variant to apply for this user/session by Variant class. Only works if the experiment is started.abstract fun <V : Variant > getExperimentVariant(experiment: KClass <V>): V? abstract fun <V : Variant > getExperimentVariant(experiment: Class <V>): V? |
Companion Object Properties
config | Entry point for Cadabra configuration. Use it at the application startup to keep all experiments configuration in one place.val config: CadabraConfig |
instance | Entry point Cadabra experiment variants usage.val instance: Cadabra |