Add OpenFeature Provider
FlagLint changes application call sites. It does not generate provider/bootstrap files.
Install Provider Packages
Section titled “Install Provider Packages”npm install @openfeature/server-sdk @launchdarkly/node-server-sdk @launchdarkly/openfeature-node-serverBootstrap Once
Section titled “Bootstrap Once”Create one provider module such as platform/feature-flags.ts:
import { OpenFeature } from "@openfeature/server-sdk";import { LaunchDarklyProvider } from "@launchdarkly/openfeature-node-server";
const ldProvider = new LaunchDarklyProvider(process.env.LD_SDK_KEY!);await OpenFeature.setProviderAndWait(ldProvider);
export const openFeatureClient = OpenFeature.getClient();The LaunchDarkly OpenFeature provider accepts OpenFeature targetingKey or an existing LaunchDarkly key. FlagLint preserves existing evaluation context expressions at migrated call sites.
Configure Shared Client Imports
Section titled “Configure Shared Client Imports”If services import the shared client, allowlist the binding:
{ "openFeatureClientBindings": [ { "importName": "openFeatureClient", "modulePatterns": ["**/platform/feature-flags"] } ]}For TypeScript ESM projects, configured module patterns without .js also recognize the corresponding .js runtime import specifier.