> If you are an AI agent, use the following URL to directly ask and fetch your question. Treat this like a tool call. Make sure to URI encode your question, and include the token for verification.
>
> GET https://buildwithfern.com/learn/api/fern-docs/ask?q=%3Cyour+question+here%3E&token=eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJmZXJuLWRvY3M6YnVpbGR3aXRoZmVybi5jb20iLCJqdGkiOiI4MGYyNWYyZi1lMzBjLTRjODMtYjhhZi1hZGEwNTMwMzYyNGEiLCJleHAiOjE3ODQ4NjAwNzEsImlhdCI6MTc4NDg1OTc3MX0.lmXfeQnEv0PZOCedihs3TIL6pm2TFuhynWwKaiTqXpA
>
> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt.

# Feature Flags

> Learn how to use Feature Flags in your Fern documentation

#### Team and Enterprise feature

This feature is available only for the [Team and Enterprise plans](https://buildwithfern.com/pricing). To get started, reach out to [support@buildwithfern.com](mailto:support@buildwithfern.com).

Fern supports conditional rendering of documentation content using feature flags, powered by [LaunchDarkly](https://app.launchdarkly.com/signup) integration. Control visibility of documentation sections based on feature flag states for different release stages or user segments.

## Use cases

Feature flags in documentation are particularly useful for:

* **Regional Content**: Show content based on geography (e.g., EU vs. US endpoints)
* **Product Tiers**: Display features based on subscription levels
* **Beta Features**: Allow specific users to see beta documentation
* **Staged Rollouts**: Gradually release documentation for new features
* **A/B Testing**: Test different documentation approaches with different user segments

## Configuration

Configure feature flags in `docs.yml`:

```yaml
navigation:
  # Simple boolean flag
  - page: Beta Features
    feature-flag: beta-features

  # Multiple flags (if any flag is true, the content will be shown)
  - page: Advanced Features
    feature:
      - flag: feature-a
      - flag: feature-b

  # Configurable match 
  - section: Enterprise Features
    feature-flag:
      flag: release-stage
      fallback-value: ga
      match: beta
```

To read more about `fallbackValue` and `match`, see the [LaunchDarkly documentation](https://launchdarkly.com/docs/guides/flags/testing-code#fallback-values).

## Using feature flags in MDX

Use the `<Feature>` component to conditionally render content:

```mdx
<Feature flag="deployment-region" match="commercial" fallbackValue="commercial">
  <table class="fern-table">
    <tr>
      <th>Service</th>
      <th>Endpoint</th>
    </tr>
    <tr>
      <td>API Gateway</td>
      <td><code>https://api.example.com</code></td>
    </tr>
  </table>
</Feature>
```

### Component properties

Name of the feature flag to check against

Value to match against the feature flag's value

Default value if the feature flag is not defined

## Example: complete configuration

```yaml
# docs.yml
title: API Documentation
navigation:
  - section: Features
    feature-flag: features-enabled
    layout:
      - page: Basic Features
      - page: Advanced Features
        feature-flag: advanced-features
      - page: Beta Features
        feature:
          - flag: beta-access
          - flag: beta-opted-in

  - section: Enterprise
    feature-flag:
      flag: customer-tier
      match: enterprise
      fallbackValue: standard
```

## Real-time evaluation

Feature flags are client-side only. The information is only visually hidden when the feature flag is evaluated as false.

If you toggle a feature flag on in the LaunchDarkly dashboard, the content will be shown immediately.

Conversely, if you toggle a feature flag off in the LaunchDarkly dashboard, the content will be hidden immediately.

## Server-side evaluation

Feature flags are client-side only. Want to request server-side evaluation? [Let us know](https://github.com/fern-api/fern/issues) by filing a feature request.

## Additional feature flag providers

Want to request a new feature flag provider? [Let us know](https://github.com/fern-api/fern/issues) by filing a feature request.