# getFeatureFlag

Retrieve the value of a LaunchDarkly feature flag.

# Reference

const value = getFeatureFlag(launchDarklyClient, key, defaultValue?)

# Parameters

  • launchDarklyClient: A LaunchDarkly SDK client instance that is ready.
  • key: The key of the feature flag to retrieve the value for.
  • defaultValue: An optional value to return if the feature flag is not available.

# Returns

The feature flag value or the defaultValue if the feature flag is not available.

# Usage

If the enable-mixpanel feature flag is not available, true will be returned.

import { getFeatureFlag } from "@squide/firefly";

const value = getFeatureFlag(launchDarklyClient, "enable-mixpanel", true);