Why
LaunchDarkly provides mature targeting, audit trails, and SDK ergonomics for larger teams. Refract keeps that power behind the sameFeatureFlagTool contract used by PostHog and LOCAL providers.
Setup
- Add
tooling-feature-flags-launch-darklytoapps/backend/package.json. - Run
make deps-install. - Configure the environment:
- Set
LAUNCHDARKLY_SDK_KEYin the deployment environment.
Evaluation context
LaunchDarkly contexts are built fromFeatureFlagContext:
userId→ context key (defaults toanonymous)organizationId,environment, andattributes→ context attributes
Gotchas
- The SDK initializes during
buildFeatureFlags()— allow a few seconds on cold start. - String flag values surface as
variantwithenabled: true. - Use
cacheMsto reduce SDK chatter; request caching still applies per HTTP request.
