> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stably.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# A/B Testing

> Learn how to disable A/B testing in staging/QA/dev environments to ensure stability and reproducibility during automated testing.

Turning off A/B testing in a staging/QA/dev environment is a common requirement to ensure stability and reproducibility during testing. Here’s a general guide on how to disable A/B testing for some popular platforms, including GrowthBook.

## [GrowthBook](https://www.growthbook.io/)

GrowthBook is designed with flexibility to enable or disable features like A/B testing easily. To turn off A/B testing in a staging environment, you can follow these steps:

<Steps>
  <Step title="Configuration">
    Access the Growthbook admin dashboard and navigate to the configuration settings.
  </Step>

  <Step title="Environment Settings">
    Identify the environment settings specific to your staging environment.

    * **Feature flags:** Use feature flags to disable all experiments. You can create a specific feature flag that, when enabled, turns off all experiments in the staging environment.
    * **Code modification:** In your application code, check the value of the feature flag before running any experiment logic.

    For example:

    ```javascript theme={null}
    if (!growthbook.isFeatureEnabled("disableExperiments")) {
        // Run experiment logic
    }
    ```
  </Step>

  <Step title="Deploy Changes">
    Save your changes and deploy them to the staging environment. Make sure your staging environment configuration does not pull production experiment configurations.
  </Step>
</Steps>

## Optimizely

Optimizely allows you to manage experiments across different environments:

<Steps>
  <Step title="Environment Setup">
    Log in to your Optimizely dashboard and go to the environment settings.
  </Step>

  <Step title="Toggle Off Experiments">
    For the staging environment, you can toggle off all experiments manually or adjust the configuration to not run any experiments.
  </Step>

  <Step title="SDK Setup">
    Adjust the SDK initialization in your staging environment to either not include any active experiments or to ignore them. For example:

    ```javascript theme={null}
    const optimizely = createInstance({
      sdkKey: "your_staging_sdk_key",
      datafileOptions: {
        autoUpdate: false,
        updateInterval: 0, // disable auto-fetching of datafile
      }
    });
    ```
  </Step>
</Steps>
