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

@bluealba/config-manager-react

v0.2.0-develop-500

Published

React wrapper for @bluealba/config-manager-core: ConfigProvider + hooks (useConfig, useConfigEntry, useConfigStatus, useConfigManager) and ConfigGuard

Readme

@bluealba/config-manager-react

React wrapper for @bluealba/config-manager-core. Provides a <ConfigProvider> that owns a ConfigManager instance and tear-free hooks built on React 18's useSyncExternalStore.

Installation

npm install @bluealba/config-manager-react @bluealba/config-manager-core

react and react-dom are peer dependencies (React 18).

Usage

Build the providers yourself (the wrapper doesn't guess your data sources) and hand them to <ConfigProvider>. It builds the manager, calls init() on mount and dispose() on unmount.

import { ConfigProvider, useConfig, useConfigStatus } from '@bluealba/config-manager-react';
import { httpProvider, pollingTransport } from '@bluealba/config-manager-core';
import { localStorageFallback } from '@bluealba/config-manager-core/browser';

function App() {
  return (
    <ConfigProvider
      providers={[httpProvider({ url: '/config' })]}
      transport={pollingTransport({ intervalMs: 5000 })}
      fallback={localStorageFallback({ key: 'app:config' })}
    >
      <Title />
      <StaleBanner />
    </ConfigProvider>
  );
}

function Title() {
  const title = useConfig<string>('feature.title', 'Default'); // re-renders only when this key changes
  return <h1>{title}</h1>;
}

function StaleBanner() {
  const status = useConfigStatus();
  if (!status.degraded) return null;
  return <div className="banner">Configuration stale — using last known copy ({status.activeSource})</div>;
}

<ConfigProvider> accepts the full ConfigManagerOptions as props: providers (required, highest→lowest precedence), transport?, fallback?, retry?, debounceMs?, validate?, context?.

Naming: antd also exports a ConfigProvider. Alias when both are used: import { ConfigProvider as ConfigManagerProvider } from '@bluealba/config-manager-react'.

API

| Export | Description | |--------|-------------| | <ConfigProvider {...options}> | Builds + owns the manager; provides it via context. | | useConfig<T>(key, defaultValue?) | Value for a key; re-renders only when that key changes. | | useConfigEntry<T>(key) | Full ConfigEntry (value + audit metadata incl. degraded). | | useConfigStatus() | ConfigStatus (healthy/degraded/activeSource/…); re-renders on transitions. | | useConfigManager() | The raw ConfigManager for imperative use (refresh(), getAll()). Throws outside a provider. | | <ConfigGuard when={fn} fallback? invert?> | Conditionally renders children based on a reactive predicate over config. |

<ConfigGuard when={({ get }) => get('feature.beta') === true} fallback={<Legacy />}>
  <BetaFeature />
</ConfigGuard>

Notes

  • Reactivity uses useSyncExternalStore, so reads never tear across concurrent renders.
  • react/react-dom must stay peers — in single-spa they are shared via the import map; a second React instance breaks context and useSyncExternalStore.
  • Dual ESM + CJS build (unbuild).

License

PolyForm-Noncommercial-1.0.0 · Blue Alba