> ## 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.

# FullStory

> This topic explains how to set up and use the LaunchDarkly FullStory integration. The integration sends LaunchDarkly flag evaluations as FullStory page properties.

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

<Note title="FullStory SDK Requirements">
  The FullStory integration requires the LaunchDarkly JavaScript SDK version 2.24 or higher, or the React Web SDK version 2.27 or higher.
</Note>

## Overview

This topic explains how to set up and use the LaunchDarkly FullStory integration. The integration sends LaunchDarkly flag evaluations as FullStory page properties.

FullStory combines analytics with high-fidelity session replay and intelligent diagnostics so you can fix issues impacting your customers' experience, even if the issues are not reported by customers.

To learn more about the use case for this integration, read [LaunchDarkly + FullStory: Targeted User Observability](https://launchdarkly.com/blog/launchdarkly-and-fullstory-integration/) on the LaunchDarkly blog.

## Set up the integration

The code below can be modified to fit your setup.

Here's how to get started:

* Install and [configure the FullStory client](https://help.fullstory.com/hc/en-us/articles/360020623514-Installing-the-FullStory-Script)
* Use the `setVars` API to send the evaluated flags to [FullStory page properties](https://help.fullstory.com/hc/en-us/articles/1500004101581-FS-setVars-API-Sending-custom-page-data-to-FullStory)In the example below, `evaluatedSessionFlags` is a two-level map. The first key is the url path. The second key is the flag key.  The final values are based on the return value of the feature flag:

<CodeGroup>
  ```js title="Inspector Setup" theme={null}
      // instantiate the path to flags mapping object outside of the Inspector
      const evaluatedSessionFlags: { [path: string]: { [flagKey: string]: unknown } } = {};

      const fsInspector: LDInspection {
        {
          type: 'flag-used',
          name: 'fullstory-inspector',
          method: (key: string, detail: LDEvaluationDetail) => {

            // FullStory attaches getCurrentSessionURL and setVars to the window object.
            // https://help.fullstory.com/hc/en-us/articles/1500004101581-FS-setVars-API-Sending-custom-page-data-to-FullStory
            if (window.FS === undefined || typeof window.FS.getCurrentSessionURL !== 'function') {
              return;
            }

            const url = window.FS.getCurrentSessionURL(true);
            if (url === undefined) {
              return;
            }

            evaluatedSessionFlags[url] = {
              ...evaluatedSessionFlags[url],
              [key]: detail.value,
            };

            const arrayOfFlags = Object.keys(evaluatedSessionFlags[url]).map(
              (flagKey) => `${flagKey}=${JSON.stringify(evaluatedSessionFlags[url][flagKey], null, 1)}`,
            );

            if (typeof window.FS.setVars === 'function') {
              window.FS.setVars('page', { ldflags: arrayOfFlags }, {integration:"launchdarkly"});
            }
          },
        },
      }
      const options = { inspectors: [fsInspector] };
      const client = LDClient.initialize('example-client-side-id', context, options);
  ```
</CodeGroup>
