Skip to content

Shared Client Architecture

Mid-sized Node.js codebases usually initialize OpenFeature once and import a shared client into service files.

platform/feature-flags.ts
exports openFeatureClient
src/checkout.ts
imports openFeatureClient
calls openFeatureClient.getBooleanValue(...)
import { openFeatureClient } from "../platform/feature-flags.js";
import { openFeatureClient as flags } from "../platform/feature-flags.js";
const openFeatureClient = OpenFeature.getClient();

Aliased imports preserve the local identifier in dry-run and apply output.

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

Ambiguous or unconfigured bindings are skipped. FlagLint does not guess that an arbitrary imported identifier is an OpenFeature client.