Feature Flags
Control documentation visibility with LaunchDarkly
Fern supports conditional rendering of documentation content using feature flags, powered by LaunchDarkly 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
:
To read more about fallbackValue
and match
, see the LaunchDarkly documentation.
Using Feature Flags in MDX
Use the <Feature>
component to conditionally render content:
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
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 by filing a feature request.
Additional Feature Flag Providers
Want to request a new feature flag provider? Let us know by filing a feature request.