Skip to main content

Overview

Migrating from LaunchDarkly to Statsig is a strategic move. It can lead to efficient feature flag management and a stronger experimentation culture. By following this guide, you’ll be well equipped to make the transition with confidence. We will cover the following topics in this guide:
  1. Conceptual differences between LaunchDarkly and Statsig
  2. Deciding what to migrate vs. not
  3. Importing flags into Statsig
  4. Flipping evaluation from LaunchDarkly to Statsig
  5. How to run the migration process

Conceptual differences between LaunchDarkly and Statsig

It is important to understand a few fundamental differences in how LaunchDarkly and Statsig structure their feature management data models: Environment: LaunchDarkly treats environments as top level concept where flags and segments must be duplicated and managed separately across environments. In Statsig, we have a centralized model where flags/configs handle environment-specific logic in their targeting rules. Flag types: LaunchDarkly uses a mix of boolean, multivariate, and JSON flags. Statsig distinguishes between Feature Flags (boolean) and Dynamic Configs (typed multivariate configs with JSON values). Targeting: LaunchDarkly relies on Contexts to evaluate flags. Statsig evaluates based on what we call a StatsigUser object.

Side by side comparison

User Context mapping example

LaunchDarkly supports multi-kind, structured user contexts. Statsig requires a user object to achieve this. In Statsig, User ID or Custom ID is equivalent to LD’s key. Known top-level fields in Statsig include userID, email, ip, userAgent, and custom. All other fields go under the custom object. Example 1: LD User context to Statsig User object conversion
4. Validate and gradually cut over Once you’ve validated that Statsig is working as expected and that your migrated flags are returning correct values, you can begin migrating more flags. We recommend that you repeat the above steps for 2-3 engineering teams to instill confidence that different use cases are covered. After you’ve maintained flags in both systems long enough to ensure things are working as expected, phase out LaunchDarkly.
  1. Remove LaunchDarkly fallback from the wrapper - Update the wrapper functions to rely solely on Statsig. This simplifies the logic and ensures LaunchDarkly is no longer queried in production.
  2. Delete LD initialization logic and SDK imports - Any references to LDClient.initialize or ldClient.variation can now be safely removed.

How to run the migration process

To ensure a safe and manageable transition to Statsig, we recommend a phased rollout that each team can adopt independently. This approach allows for gradual migration, scoped validation, and shared learnings across the org. We hope this guide helped you better understand how to approach LaunchDarkly to Statsig feature flag migration. If you need any further assistance or just want to talk through your specific case, please talk to us and we’ll happy to work with you.