@showwhat/openfeature
v2.0.0
Published
OpenFeature provider for showwhat library
Maintainers
Readme
@showwhat/openfeature
OpenFeature provider for showwhat.
Bridge showwhat's rule engine to the standard OpenFeature Server SDK. Evaluate flags and config through OpenFeature clients using showwhat definitions.
Installation
npm install showwhat @showwhat/openfeature @openfeature/server-sdk@openfeature/server-sdk is a peer dependency.
Quick start
import { OpenFeature } from "@openfeature/server-sdk";
import { ShowwhatProvider } from "@showwhat/openfeature";
import { MemoryData } from "showwhat";
const data = await MemoryData.fromYaml(yamlString);
await OpenFeature.setProviderAndWait(new ShowwhatProvider({ data }));
const client = OpenFeature.getClient();
const enabled = await client.getBooleanValue("checkout_v2", false, {
env: "production",
});Features
- All four evaluation types: boolean, string, number, object
- Automatic context mapping from OpenFeature to showwhat
- Custom condition support via
evaluatorsoption - Lifecycle management (
initialize/onClose) - Error mapping to OpenFeature error codes
- Resolution reason tracking
Documentation
- OpenFeature Integration - provider options, context mapping, evaluation types, error mapping, and lifecycle
