Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose usable method(s) to grab the user's variation for a feature test #425

Open
DDChiang opened this issue Mar 12, 2020 · 1 comment
Open

Comments

@DDChiang
Copy link

DDChiang commented Mar 12, 2020

How would the enhancement work?

This is an idea proposal for exposing a getVariationForFeature-like method (s) directly on the optimizelyClientInstance so 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 .getFeatureVariableBoolean or getFeatureVariableString).

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:

  1. trigger/log the impression back to Optimizely and also return the variation
  2. only return the variation (won't create an impression)

--
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-sdk version: 3.5.0 (pretty much all current versions)

@DDChiang DDChiang changed the title Idea: Expose usable method(s) to grab the user's variation for a feature test Expose usable method(s) to grab the user's variation for a feature test Mar 12, 2020
@mikechu-optimizely
Copy link
Contributor

@DDChiang, Do you still need this enhancement request? If so, I'll move it to our feature request/management system.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants