Documentation Index
Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
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)
- Apex
- C++ (server-side)
- Erlang
- Go
- Haskell
- Java
- Lua
- Node.js (server-side)
- PHP
- Python
- Ruby
- Rust
.NET (server-side)
Expand .NET (server-side) code sample
Expand .NET (server-side) code sample
The To learn more, read To learn more, read
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:EvaluationDetail, BoolVariationDetail.Here is an example of how to access the details of a reason object:EvaluationReason.Apex
Expand Apex code sample
Expand Apex code sample
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)
Expand C++ (server-side) code sample
Expand C++ (server-side) code sample
You can request and then programmatically inspect the reason for a particular feature flag evaluation.The To learn more, read
detail.Reason() response is described in Evaluation reasons.Here is an example:EvaluationDetail.Erlang
Expand Erlang code sample
Expand Erlang code sample
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
Expand Go code sample
Expand Go code sample
The To learn more, read To learn more, read
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:EvaluationDetail and BoolVariationDetail.Here is an example of how to access the details of a reason object: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
Expand Haskell code sample
Expand Haskell code sample
The To learn more, read
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:EvaluationDetail and boolVariationDetail.Java
Expand Java code sample
Expand Java code sample
The To learn more, read To learn more, read
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:EvaluationDetail and boolVariationDetail.Here is an example of how to access the details of a reason object:EvaluationReason.Lua
Expand Lua code sample
Expand Lua code sample
By using the To learn more, read
*VariationDetail family of variation calls you can programmatically inspect the reason for a particular evaluation:boolVariationDetail.Node.js (server-side)
Expand Node.js (server-side) code sample
Expand Node.js (server-side) code sample
The To learn more, read To learn more, read
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:LDEvaluationDetail and variationDetail.Here is an example of how to access the details of a reason object:LDEvaluationReason.PHP
Expand PHP code sample
Expand PHP code sample
The To learn more, read To learn more, read
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:EvaluationDetail and variationDetail.Here is an example of how to access the details of a reason object:EvaluationReason.Python
Expand Python code sample
Expand Python code sample
The To learn more, read To learn more, read
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:EvaluationDetail and variation_detail.Here is an example of how to access the details of a reason object:EvaluationDetail.reason.Ruby
Expand Ruby code sample
Expand Ruby code sample
The To learn more, read To learn more, read
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:EvaluationDetail and variation_detail.Here is an example of how to access the details of a reason object:EvaluationDetail.reason.Rust
Expand Rust code sample
Expand Rust code sample
The To learn more, read To learn more, read
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:variation_detail and bool_variation_detail.Here is an example of how to access the details of a reason object:Reason.