Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upExpose usable method(s) to grab the user's variation for a feature test #425
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How would the enhancement work?
This is an idea proposal for exposing a
getVariationForFeature-like method (s) directly on theoptimizelyClientInstanceso developers can quickly figure out and directly reference the variation the user is bucketed in for a Optimizely Fullstack feature test. Currently we must use a hack of seeing whether a feature is enabled for a user (via.isFeatureEnabled()) and what feature variables we set to differentiate between multiple different feature test variants (via.getFeatureVariableBooleanorgetFeatureVariableString).Similar to how the sdk has already exposed a method we can use to grab an AB experiment's variation, there'll probably be 2 separate methods that will:
--
Side note: I noticed in this codebase line referencing optimizelyInstance.getVariationForFeature that there already is a way to grab the feature test but it's not exposed as a method we can directly call off the Optimizely client instance.
When would the enhancement be useful?
Next release if possible! We have more feature tests coming in where it would be helpful to be able to directly reference a feature test variant in code, rather than "guess" the variant with more complicated code.
@optimizely/optimizely-sdkversion: 3.5.0 (pretty much all current versions)