nona-openfeature-provider
v4.1.0
Published
OpenFeature provider for Nona — use Nona remote config and feature flags through the OpenFeature server SDK.
Maintainers
Readme
nona-openfeature-provider
OpenFeature provider for Nona. Use Nona remote config and feature flags through the OpenFeature server SDK.
Install
npm install nona-client nona-openfeature-provider @openfeature/server-sdkUsage
import { OpenFeature } from "@openfeature/server-sdk";
import { createNonaOpenFeatureProvider } from "nona-openfeature-provider";
await OpenFeature.setProviderAndWait(
createNonaOpenFeatureProvider({
baseUrl: "https://nona.example.com",
apiKey: "your-api-key",
environmentId: "production"
})
);
const client = OpenFeature.getClient();
const enabled = await client.getBooleanValue("Features:Checkout", false);Nona API keys are bound to a project, so provider configuration only needs the Nona server URL, API key, and environment id. The provider passes useReleases and releaseVersion through to nona-client; it does not implement separate source routing. When useReleases is false or omitted, releaseVersion is retained but ignored. Only config_entry_not_found maps to OpenFeature FLAG_NOT_FOUND. Other HTTP failures remain provider errors.
Integration test
The test suite includes an optional real-server test. Seed a Nona environment with these entries, or override the key/value environment variables:
openfeature:boolean=true(boolean)openfeature:number=42(number)openfeature:string=Checkout(text)openfeature:object={"color":"green","enabled":true}(json)
NONA_INTEGRATION_BASE_URL=http://localhost:18080 \
NONA_INTEGRATION_API_KEY=your-api-key \
NONA_INTEGRATION_ENVIRONMENT_ID=production \
npm test