Skip to main content

Feature Flags API

The Feature Flags API documentation is being developed. Feature flags are typically managed through the Mixpanel UI.For programmatic feature flag evaluation, use the Mixpanel SDKs which provide built-in support for:
  • Evaluating flag values for users
  • Tracking flag exposure events
  • A/B testing and experimentation

Using Feature Flags

While there isn’t a dedicated REST API for managing feature flags, you can:
  1. Define flags in the UI: Create and configure feature flags in Project Settings
  2. Evaluate with SDKs: Use Mixpanel JavaScript, Python, or other SDKs to evaluate flags
  3. Track with Events: Flag evaluations are automatically tracked as events

Example with JavaScript SDK

Example with Python SDK

Best Practices

Use kebab-case for flag names:
  • new-checkout-flow
  • enable-dark-mode
  • experiment-pricing-v2
Mixpanel SDKs automatically track when flags are evaluated, helping you understand:
  • Which users see which variants
  • Impact of feature flags on key metrics
  • A/B test results
Remove flags from code once features are fully rolled out:

SDK Documentation

For detailed information on using feature flags, see the SDK-specific documentation: