npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@quonfig/openfeature-node

v0.0.8

Published

OpenFeature provider for Quonfig -- Node.js

Readme

@quonfig/openfeature-node

OpenFeature provider for Quonfig -- Node.js server-side SDK.

This package wraps the @quonfig/node native SDK and implements the OpenFeature server-side Provider interface.

Install

npm install @quonfig/openfeature-node @quonfig/node @openfeature/server-sdk

Usage

import { QuonfigProvider } from "@quonfig/openfeature-node";
import { OpenFeature } from "@openfeature/server-sdk";

const provider = new QuonfigProvider({
  sdkKey: "qf_sk_production_...",
  // targetingKeyMapping: "user.id", // default
});

await OpenFeature.setProviderAndWait(provider);

const client = OpenFeature.getClient();

// Boolean flag
const enabled = await client.getBooleanValue("my-feature", false);

// String config
const welcomeMsg = await client.getStringValue("welcome-message", "Hello!");

// Number config
const timeout = await client.getNumberValue("request-timeout-ms", 5000);

// Object config (JSON or string_list)
const allowedPlans = await client.getObjectValue("allowed-plans", []);

// With evaluation context (per-request)
const isProFeatureEnabled = await client.getBooleanValue("pro-feature", false, {
  targetingKey: "user-123", // maps to user.id by default
  "user.plan": "pro",
  "org.tier": "enterprise",
});

Context mapping

OpenFeature context is flat; Quonfig context is nested by namespace. This provider maps between them using dot-notation:

| OpenFeature context key | Quonfig namespace | Quonfig property | | ----------------------- | ----------------- | --------------------------------------------- | | targetingKey | user | id (configurable via targetingKeyMapping) | | "user.email" | user | email | | "org.tier" | org | tier | | "country" (no dot) | "" (default) | country | | "user.ip.address" | user | ip.address (first dot only) |

Customizing targetingKey mapping

const provider = new QuonfigProvider({
  sdkKey: "qf_sk_...",
  targetingKeyMapping: "account.id", // maps targetingKey to { account: { id: ... } }
});

Accessing native SDK features

The getClient() escape hatch returns the underlying @quonfig/node client for features not available in OpenFeature:

const native = provider.getClient();

// Log level integration
const shouldLog = native.shouldLog({
  loggerName: "auth",
  desiredLevel: "DEBUG",
  contexts: { user: { id: "user-123" } },
});

// List all config keys
const keys = native.keys();

// Access raw config
const rawConfig = native.rawConfig("my-flag");

What you lose vs. the native SDK

OpenFeature is designed for feature flags, not general configuration. Some Quonfig features require the native @quonfig/node SDK:

  1. Log levels -- shouldLog() and logger() are native-only.
  2. string_list configs -- must be accessed via getObjectValue() and cast to string[].
  3. duration configs -- return the raw millisecond number via getNumberValue().
  4. bytes configs -- not accessible via OpenFeature (no binary type in OF).
  5. keys() and rawConfig() -- native-only via getClient().
  6. Context keys use dot-notation -- "user.email", not nested objects.
  7. targetingKey maps to user.id by default -- configure targetingKeyMapping if different.

Configuration changed events

The provider emits ProviderEvents.ConfigurationChanged when Quonfig pushes a live config update via SSE. Register a handler on the OpenFeature API or client:

OpenFeature.addHandler(ProviderEvents.ConfigurationChanged, () => {
  console.log("Configs updated!");
});