Skip to main content

Server-side SDKs

Unlike client-side SDKs, you do not need to enable an evaluation reason configuration option in server-side SDKs for this feature to work. This feature is available in the following server-side SDKs:

.NET (server-side)

The VariationDetail methods, such as BoolVariationDetail, work the same as the Variation methods, but also provide additional “reason” information about how a flag value was calculated. For example, you can find out if the context was individually targeted for the flag or was matched by one of the flag’s rules. You can examine the “reason” data programmatically, or, if you capture detailed analytics events for flags, view it with Data Export.Here is an example:
To learn more, read EvaluationDetail, BoolVariationDetail.Here is an example of how to access the details of a reason object:
To learn more, read EvaluationReason.

Apex

By passing an LDClient.EvaluationDetail object to a variation call you can programmatically inspect the reason for a particular evaluation.Here is an example:

C++ (server-side)

You can request and then programmatically inspect the reason for a particular feature flag evaluation.The detail.Reason() response is described in Evaluation reasons.Here is an example:
To learn more, read EvaluationDetail.

Erlang

The variation_detail function is similar to the variation function, but also returns an explanation of the evaluation that you can inspect programmatically.Here is an example:

Go

The VariationDetail methods, such as BoolVariationDetail, work the same way as Variation, but also provide additional “reason” information about how a flag value was calculated. For example, you can find out if the context was individually targeted by the flag or was matched by one of the flag’s rules. You can examine the “reason” data programmatically, or, if you capture detailed analytics events for flags, view it with Data Export.Here is an example:
To learn more, read EvaluationDetail and BoolVariationDetail.Here is an example of how to access the details of a reason object:
To learn more, read EvaluationReason.If you are using OpenTelemetry, then instead of using the VariationDetail method for each type, you must use the VariationDetailCtx method for each type. For example, use BoolVariationDetailCtx rather than BoolVariationDetail. The methods are the same except that the VariationDetailCtx methods also require a Go context parameter. This Go context is used in the hook implementation that provides OpenTelemetry support. To learn more, read OpenTelemetry.

Haskell

The variationDetail functions are similar to the variation functions, but they also return an explanation of the evaluation that is programmatically inspectable.Here is an example:
To learn more, read EvaluationDetail and boolVariationDetail.

Java

The variationDetail methods, such as boolVariationDetail, work the same as variation, but also provide additional “reason” information about how a flag value was calculated. For example, you can find out if the context was individually targeted for the flag or was matched by one of the flag’s rules. You can examine the “reason” data programmatically, or, if you capture detailed analytics events for flags, view it with Data Export.Here is an example:
To learn more, read EvaluationDetail and boolVariationDetail.Here is an example of how to access the details of a reason object:
To learn more, read EvaluationReason.

Lua

By using the *VariationDetail family of variation calls you can programmatically inspect the reason for a particular evaluation:
To learn more, read boolVariationDetail.

Node.js (server-side)

The variationDetail method lets you evaluate a feature flag (using the same parameters as you would for variation) and receive more information about how the value was calculated.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 context 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, or, if you capture detailed analytics events for flags, view it with Data Export.Here is an example:
To learn more, read LDEvaluationDetail and variationDetail.Here is an example of how to access the details of a reason object:
To learn more, read LDEvaluationReason.

PHP

The variationDetail method lets you evaluate a feature flag (using the same parameters as you would for variation) and receive more information about how the value was calculated.The variation detail is returned in an object that contains both the result value and a “reason” object which will tell you, for example, if the context 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, or, if you capture detailed analytics events for flags, view it with Data Export.Here is an example:
To learn more, read EvaluationDetail and variationDetail.Here is an example of how to access the details of a reason object:
To learn more, read EvaluationReason.

Python

The variation_detail method lets you evaluate a feature flag with the same parameters as you would for variation. You can use this method to receive more information about how the value was calculated.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 context 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, or, if you capture detailed analytics events for flags, view it with Data Export.Here is an example:
To learn more, read EvaluationDetail and variation_detail.Here is an example of how to access the details of a reason object:
To learn more, read EvaluationDetail.reason.

Ruby

The variation_detail method lets you evaluate a feature flag (using the same parameters as you would for variation) and receive more information about how the value was calculated.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 context 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, or, if you capture detailed analytics events for flags, view it with Data Export.Here is an example:
To learn more, read EvaluationDetail and variation_detail.Here is an example of how to access the details of a reason object:
To learn more, read EvaluationDetail.reason.

Rust

The variation_detail methods (for example, bool_variation_detail) let you evaluate a feature flag, using the same parameters as you would for variation, and receive more information about how the flag value was calculated. For example, you can find out if the context was individually targeted for the flag or was matched by one of the flag’s rules. You can examine the “reason” data programmatically, or, if you capture detailed analytics events for flags, view it with Data Export.Here is an example:
To learn more, read variation_detail and bool_variation_detail.Here is an example of how to access the details of a reason object:
To learn more, read Reason.