@e-volv/openfeature-node
v0.1.1
Published
OpenFeature provider for e-volv Launch — evaluates feature flags locally through @e-volv/logs with streaming delivery, a last-known cache and exposures.
Maintainers
Readme
@e-volv/openfeature-node
OpenFeature provider for e-volv Launch feature flags, on
the Node.js reference SDK (@e-volv/logs). Flags are evaluated locally —
streaming delivery, polling fallback, a last-known cache and exposure
tracking all live in the underlying client; this package only adapts it to
the OpenFeature server API.
Install
npm install @e-volv/openfeature-node @openfeature/server-sdk @e-volv/logsUse
import { OpenFeature } from '@openfeature/server-sdk';
import { init } from '@e-volv/logs';
import { EvolveProvider } from '@e-volv/openfeature-node';
const evolve = init({ key: process.env.EVOLVE_KEY });
await OpenFeature.setProviderAndWait(new EvolveProvider(evolve.flags));
const flags = OpenFeature.getClient();
const checkout = await flags.getBooleanDetails('checkout.new', false, {
targetingKey: user.id,
plan: user.plan,
});Every evaluation resolves synchronously against the held ruleset (the
provider's initialize() waits up to 5 s for the first delivery), so reads
never block on the network. The native API remains available on
evolve.flags when OpenFeature is not wanted.
Reason mapping
| e-volv reason (flagMetadata.evolveReason) | OpenFeature reason |
| ------------------------------------------- | -------------------------- |
| RULE:*, TARGET_MATCH | TARGETING_MATCH |
| ROLLOUT | SPLIT |
| OFF, KILLED | DISABLED |
| DEFAULT, PREREQUISITE_FAILED | DEFAULT |
| FLAG_NOT_FOUND | ERROR (FLAG_NOT_FOUND) |
| TYPE_MISMATCH | ERROR (TYPE_MISMATCH) |
| ERROR | ERROR (GENERAL) |
The full e-volv reason is always present on flagMetadata.evolveReason.
Per the OpenFeature contract, when a resolution carries an errorCode the
client substitutes the caller's default value and drops the variant — so an
errored evaluation returns your default, while flagMetadata.evolveReason
still names the native e-volv reason.
Lifecycle and exposures
The LogsClient owns delivery and telemetry: closing the OpenFeature
client (OpenFeature.close()) does not stop the underlying client, and
exposures are recorded by @e-volv/logs on each evaluation of a flag that
is present in the ruleset. Shut the client down with evolve.close()
(also flushable via evolve.flush()).
Conformance
The provider is tested against the whole @e-volv/flags-kernel fixture:
every case must resolve to the same value, variant and reason as the native
flags.detail API (__tests__/provider.spec.ts).
