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

@bota-apps/fm

v0.8.3

Published

Feature-management and error-boundary runtime: a feature tree drives per-action error classification, telemetry, and notifications, with React providers and hooks.

Readme

@bota-apps/fm

Feature-management and error-boundary runtime. One feature tree per app drives per-action error classification, telemetry, and notifications, plus gating and navigation. Error handling is owned by the feature node — not sprinkled at call sites — and the package depends on no UI or telemetry SDK: the app wires concretes via configureFeatureRuntime.

Each feature node yields a FeatureScope with two faces: a gating face (available/status, driven by collectors) and a boundary face (run/recover that classifies errors, emits one telemetry fingerprint, and notifies once). The SHAPE types live in @bota-apps/types/fm; this package is the runtime (error classes, classifier, registries, tree resolver, scope/boundary, React providers) and re-exports those types for convenience.

Install

pnpm add @bota-apps/fm
# peer: react

Usage

Wire the runtime seam once at bootstrap, then build a registry from the tree:

import { configureFeatureRuntime, createFeatureRegistry } from "@bota-apps/fm";
import type { FeatureNodeDef } from "@bota-apps/fm";

// 1. Inject the app's UI/telemetry/auth concretes once.
configureFeatureRuntime({
  notify: ({ message, level }) => toast({ title: message, variant: level }),
  track: (event) => analytics.track(event.fingerprint, event.context),
  requestLogout: () => authClient.logout(),
});

// 2. Define the tree and build a registry (provide it via <FeatureProvider>).
const tree = { id: "app", children: [/* … */] } as const satisfies FeatureNodeDef;
export const featureRegistry = createFeatureRegistry(tree);

Provide the registry and resolve a scope in a component, then run an action under its boundary:

import { FeatureProvider, useFeatureScope } from "@bota-apps/fm";

<FeatureProvider registry={featureRegistry}>{children}</FeatureProvider>;

function CreateProject() {
  const scope = useFeatureScope("projects:create");
  const onSubmit = (values) =>
    scope.run(() => api.createProject(values), { success: { onSuccess } });
  // classifies errors, emits one telemetry fingerprint, notifies once — no try/catch
}

Gate UI on a feature's resolved status without a boundary:

import { FeatureGate, useFeatureStatus } from "@bota-apps/fm";

<FeatureGate feature="billing:projects">
  <ProjectsPanel />
</FeatureGate>;

API

The package groups its runtime into a few areas:

| Area | Exports (selection) | | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Errors | AppError, ApiError, GraphQLError, ValidationError, BusinessRuleError, AuthError, NetworkError, UnexpectedError, classifyError, featureErrorRegistry | | Boundary | configureFeatureRuntime / getFeatureRuntime, runFeatureAction, tryOrDefault, reportQueryError, buildFeatureOptions, routeClassifiedError | | Tree | createFeatureRegistry, resolveFeature / resolveFeaturePath / resolveFeatureTree, composeFeatureTree, deriveFeatureAnnotations, defaultCollectors (flag/permission/plan/limit/setup) | | Scope | makeScope | | Apps/manifest | appManifestToFeature / appManifestToContribution, mountAppContributions, toAppManifest, useFeatureRegistry, resolveLucideIcon | | Capabilities | capabilitiesToFeatureInputs, buildResourceTree / collectResourceIds / pruneToGranted | | React | FeatureProvider, FeatureScopeProvider, FeatureGate, createFeatureAccess, and the useFeature* hooks (useFeatureScope, useFeature, useFeatureStatus, useFeatureChildren, useFeatureTree, useFeatureAnnotations, useFeatureSetup) |

Shape types (FeatureNodeDef, FeatureScope, ResolvedFeature, FeatureRuntime, TrackEvent, NotifyMessage, the AppManifest family, the Extract* id helpers, …) are re-exported from @bota-apps/types/fm.

Part of the @bota-apps packages monorepo.