> ## Documentation Index
> Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Flag evaluation reasons: Edge SDKs

> This topic explains how to use the flag evaluation reason feature to get more information about the flag variations LaunchDarkly serves to contexts or users. This page covers edge sdks.

> For the complete documentation index, see [llms.txt](/llms.txt). For the full documentation snapshot, see [llms-full.txt](/llms-full.txt).

## Edge SDKs

This feature is available for all of our edge SDKs:

* [Akamai](#akamai)
* [Cloudflare](#cloudflare)
* [Fastly](#fastly)
* [Vercel](#vercel)

### Akamai

<Accordion title="Expand Akamai code sample">
  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 SDK returns the variation detail in an object that contains both the result value and a `reason` object. These tell you more information. For example, they can tell you if the flag individually targeted the context, or if the context matched 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.

  Here is an example:

  <CodeGroup>
    ```typescript title="TypeScript" theme={null}
          const { value, variationIndex, reason } = await client.variationDetail(flagKey, context, false);
    ```
  </CodeGroup>

  To learn more, read [`variationDetail`](https://launchdarkly.github.io/js-core/packages/sdk/akamai-edgekv/docs/interfaces/LDClient.html#variationDetail), [`LDEvaluationDetail`](https://launchdarkly.github.io/js-core/packages/sdk/akamai-edgekv/docs/index.html#LDEvaluationDetail) and [`LDEvaluationReason`](https://launchdarkly.github.io/js-core/packages/sdk/akamai-edgekv/docs/index.html#LDEvaluationReason).

  The `LDClient` also provides typed variation methods for type-safe usage in TypeScript: [`boolVariationDetail`](https://launchdarkly.github.io/js-core/packages/sdk/akamai-edgekv/docs/interfaces/LDClient.html#boolVariationDetail), [`stringVariationDetail`](https://launchdarkly.github.io/js-core/packages/sdk/akamai-edgekv/docs/interfaces/LDClient.html#stringVariationDetail), [`numberVariationDetail`](https://launchdarkly.github.io/js-core/packages/sdk/akamai-edgekv/docs/interfaces/LDClient.html#numberVariationDetail), [`jsonVariationDetail`](https://launchdarkly.github.io/js-core/packages/sdk/akamai-edgekv/docs/interfaces/LDClient.html#jsonVariationDetail).

  Every time you evaluate a flag, the SDK fetches the flag data from the EdgeKV store. Your Akamai resource tier may limit how many of these queries you can make while a single worker handler is being executed. To learn more, read [Understand resource limits and caching options](/sdk/edge/akamai#understand-resource-limits-and-caching-options).
</Accordion>

### Cloudflare

<Accordion title="Expand Cloudflare code sample">
  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 SDK returns the variation detail in an object that contains both the result value and a "reason" object. These tell you, for instance, if the flag individually targeted the context or if the context matched 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:

  <CodeGroup>
    ```typescript title="TypeScript" theme={null}
          const { value, variationIndex, reason } = await client.variationDetail(flagKey, context, false);
    ```
  </CodeGroup>

  To learn more, read [`variationDetail`](https://launchdarkly.github.io/js-core/packages/sdk/cloudflare/docs/classes/LDClient.html#variationDetail), [`LDEvaluationDetail`](https://launchdarkly.github.io/js-core/packages/sdk/cloudflare/docs/interfaces/LDEvaluationDetail.html) and [`LDEvaluationReason`](https://launchdarkly.github.io/js-core/packages/sdk/cloudflare/docs/interfaces/LDEvaluationDetail.html#reason).

  The `LDClient` also provides typed variation methods for type-safe usage in TypeScript: [`boolVariationDetail`](https://launchdarkly.github.io/js-core/packages/sdk/cloudflare/docs/classes/LDClient.html#boolVariationDetail), [`stringVariationDetail`](https://launchdarkly.github.io/js-core/packages/sdk/cloudflare/docs/classes/LDClient.html#stringVariationDetail), [`numberVariationDetail`](https://launchdarkly.github.io/js-core/packages/sdk/cloudflare/docs/classes/LDClient.html#numberVariationDetail), [`jsonVariationDetail`](https://launchdarkly.github.io/js-core/packages/sdk/cloudflare/docs/classes/LDClient.html#jsonVariationDetail).
</Accordion>

### Fastly

<Accordion title="Expand Fastly code sample">
  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 SDK returns the variation detail in an object that contains both the result value and a "reason" object. These tell you more information. For example, they can tell you if the flag individually targeted the context, or if the context matched 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:

  <CodeGroup>
    ```ts title="TypeScript" theme={null}
          const { value, variationIndex, reason } = await client.variationDetail('example-flag-key', context, false);
    ```
  </CodeGroup>

  To learn more, read [`variationDetail`](https://launchdarkly.github.io/js-core/packages/sdk/fastly/docs/classes/LDClient.html#variationDetail) and [`LDEvaluationReason`](https://launchdarkly.github.io/js-core/packages/sdk/fastly/docs/interfaces/LDEvaluationReason.html).

  The `LDClient` also provides typed variation methods for type-safe usage in TypeScript: [`boolVariationDetail`](https://launchdarkly.github.io/js-core/packages/sdk/fastly/docs/classes/LDClient.html#boolVariationDetail), [`stringVariationDetail`](https://launchdarkly.github.io/js-core/packages/sdk/fastly/docs/classes/LDClient.html#stringVariationDetail), [`numberVariationDetail`](https://launchdarkly.github.io/js-core/packages/sdk/fastly/docs/classes/LDClient.html#numberVariationDetail), [`jsonVariationDetail`](https://launchdarkly.github.io/js-core/packages/sdk/fastly/docs/classes/LDClient.html#jsonVariationDetail).
</Accordion>

### Vercel

<Accordion title="Expand Vercel code sample">
  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 SDK returns the variation detail in an object that contains both the result value and a "reason" object. These tell you more information. For example, they can tell you if the flag individually targeted the context, or if the context matched 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:

  <CodeGroup>
    ```typescript title="TypeScript" theme={null}
          const { value, variationIndex, reason } = await client.variationDetail(flagKey, context, false);
    ```
  </CodeGroup>

  To learn more, read [`variationDetail`](https://launchdarkly.github.io/js-core/packages/sdk/vercel/docs/classes/LDClient.html#variationDetail), [`LDEvaluationDetail`](https://launchdarkly.github.io/js-core/packages/sdk/vercel/docs/interfaces/platform-1.LDEvaluationDetail.html) and [`LDEvaluationReason`](https://launchdarkly.github.io/js-core/packages/sdk/vercel/docs/interfaces/platform-1.LDEvaluationReason.html).

  The `LDClient` also provides typed variation methods for type-safe usage in TypeScript: [`boolVariationDetail`](https://launchdarkly.github.io/js-core/packages/sdk/vercel/docs/classes/LDClient.html#boolVariationDetail), [`stringVariationDetail`](https://launchdarkly.github.io/js-core/packages/sdk/vercel/docs/classes/LDClient.html#stringVariationDetail), [`numberVariationDetail`](https://launchdarkly.github.io/js-core/packages/sdk/vercel/docs/classes/LDClient.html#numberVariationDetail), [`jsonVariationDetail`](https://launchdarkly.github.io/js-core/packages/sdk/vercel/docs/classes/LDClient.html#jsonVariationDetail).
</Accordion>
