Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #80 from msiadak/patch-1
Browse files Browse the repository at this point in the history
JS Client SDK: Add callout to use evaluationDetails option in variationDetail section
  • Loading branch information
scribblingfox authored Sep 17, 2020
2 parents 8d77d2a + 4306dac commit 78d7a78
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/content/topics/sdk/client-side/javascript/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,15 @@ The default value will only be returned if an error is encountered—for example

The `variationDetail` method allows you to evaluate a feature flag (using the same parameters as you would for `variation`) and receive more information about how the value was calculated.

<Callout intent="alert">
<CalloutTitle>You must enable the evaluationReasons option</CalloutTitle>
<CalloutDescription>
You must enable the `evaluationReasons` option when you initialize the LaunchDarkly client. If you do not do this, the `reason` object returned by this method will always be null.

To learn more, read [Customizing your client](#customizing-your-client).
</CalloutDescription>
</Callout>

The variation detail is returned in an object that contains both the result value and a "reason" object which will tell you, for instance, if the user was individually targeted for the flag or was matched by one of the flag's rules. It will also indicate if the flag returned the default value due to an error.

You can examine the "reason" data programmatically; you can also view it with data export, if you are capturing detailed analytics events for this flag.
Expand Down

0 comments on commit 78d7a78

Please sign in to comment.