Download our FREE ebook of 43 A/B testing case studies from the world's leading companies for test ideas and inspiration. Download Now

Optimizely Blog

Tips & Tricks for Building Your Experimentation Program

X

Download our FREE Testing Toolkit for A/B testing ideas, planning worksheets, presentation templates, and more!

Get It Now



Promo Image

We love highlighting the great work folks are doing in progressive delivery & experimentation. Recently, our customer Patxi Bocos created a a library that generates type safe accessors for experiments and features of a given Optimizely project.

We wanted to repost his Medium article with his library to share with our broader community. Take a look and keep the conversation going in our Slack developer community.

What is poetimizely?

poetimizely is a library to generate type safe accessors for Optimizely experiments and features.

Why should I use it?

Experiments 🧪

val variation = optimizelyClient.activate("experiment-key", userId)
when (variation?.key) {
    "variation-1" -> TODO()
    "variation-2" -> TODO()
    null -> TODO()
}
val variation = optimizelyClient.getVariationForExperiment(Experiments.TestExperiment, userId)
when (variation?.key) {
    TestExperimentVariations.VARIATION_1 -> TODO()
    TestExperimentVariations.VARIATION_2 -> TODO()
    null -> TODO()
}

Features 💡

val enabled = optimizelyClient.isFeatureEnabled("feature-key", userId)
val enabled = optimizelyClient.isFeatureEnabled(Features.FEATURE_KEY, userId)
Optimizely X