Skip to content

OpenFeature Provider Setup

FlagLint changes the application-facing evaluation boundary. LaunchDarkly remains the feature flag provider.

Official references:

For a Node.js server-side LaunchDarkly service:

Terminal window
npm install \
@openfeature/server-sdk \
@launchdarkly/node-server-sdk \
@launchdarkly/openfeature-node-server

Do not remove existing LaunchDarkly dependencies until no remaining source files or wrappers import them.

Create one provider/bootstrap module owned by your platform layer:

import { OpenFeature } from "@openfeature/server-sdk";
import { LaunchDarklyProvider } from "@launchdarkly/openfeature-node-server";
await OpenFeature.setProviderAndWait(
new LaunchDarklyProvider(process.env.LD_SDK_KEY!)
);
export const openFeatureClient = OpenFeature.getClient();

Application services should import the exported OpenFeature client and evaluate flags through OpenFeature:

import { openFeatureClient } from "../platform/feature-flags.js";
export async function checkout(ctx: { key: string }) {
return await openFeatureClient.getBooleanValue("checkout-v2", false, ctx);
}

The LaunchDarkly OpenFeature provider accepts OpenFeature targetingKey or an existing LaunchDarkly key. FlagLint preserves existing evaluation context arguments at migrated call sites.

{
"openFeatureClientBindings": [
{
"importName": "openFeatureClient",
"modulePatterns": ["**/platform/feature-flags"]
}
]
}

Provider/bootstrap setup is not generated by FlagLint.