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

@factoredui/react

v0.5.1

Published

React bindings for FactoredUI — provider, hooks, path context, SDUI renderer

Readme

@factoredui/react

React bindings for FactoredUI — provider, hooks, path context, and SDUI renderer.

Part of the FactoredUI monorepo.

Install

npm install @factoredui/core @factoredui/react @supabase/supabase-js

Setup

Wrap your app in <Provider>. This initializes capture automatically.

import { createClient } from '@supabase/supabase-js'
import { Provider } from '@factoredui/react'

const supabase = createClient(url, anonKey, {
  db: { schema: 'factoredui' }
})

function App() {
  return (
    <Provider supabase={supabase}>
      <YourApp />
    </Provider>
  )
}

Provider props:

  • supabase — Supabase client (required)
  • adapter — custom CaptureAdapter (defaults to web adapter)
  • platform"web" | "ios" | "android" (defaults to "web")
  • flushIntervalMs — event batch interval (default 5000)
  • flushBatchSize — max events per batch (default 50)
  • sessionTimeoutMs — session inactivity timeout (default 30 min)

Path Context

Structure your component tree with path providers. Events are automatically tagged with hierarchical paths.

import { Flow, Page, Component, Element } from '@factoredui/react'

<Flow name="onboarding">
  <Page name="review">
    <Component name="photo-grid">
      <Element name="upload-button">
        <button>Upload</button>
      </Element>
    </Component>
  </Page>
</Flow>
// Path: onboarding/review/photo-grid/upload-button

Read the current path anywhere:

import { useComponentPath } from '@factoredui/react'

const path = useComponentPath()
// → "onboarding/review/photo-grid"

Hooks

All hooks use the Supabase client from <Provider> context.

useFlag

import { useFlag } from '@factoredui/react'

function CheckoutPage() {
  const { variant, loading, error } = useFlag('checkout-redesign')

  if (loading) return <Spinner />
  if (error) return <Fallback />

  return variant === 'treatment' ? <NewCheckout /> : <OldCheckout />
}

useFactors / useComponentFactors

const { factors, loading } = useFactors()                       // current user's factors
const { factors, loading } = useComponentFactors('checkout/cta') // aggregated for a component

useGovernanceLog

const { entries, loading } = useGovernanceLog(experimentId)
// Realtime — updates as new governance verdicts arrive

useExperimentDashboard

const { experiments, loading } = useExperimentDashboard({ status: 'running' })

useExperimentResults

const { results, loading } = useExperimentResults(experimentId, ['completion_rate', 'error_rate'])

usePlatform

const platform = usePlatform() // "web" | "ios" | "android"

SDUI Renderer

Render server-driven UI specs:

import { renderSpec } from '@factoredui/react'
import { loadSpec, createSpecStorage, devSignatureVerifier } from '@factoredui/core'

const spec = await loadSpec(supabase, 'home-hero', storage, devSignatureVerifier)

function HeroSection() {
  return <>{renderSpec(spec.tree, componentRegistry, actionRegistry, dataSources)}</>
}

useSourceData

Resolve async data sources for spec bindings:

import { useSourceData } from '@factoredui/react'

const { data, loading, error } = useSourceData(spec.dataSources, supabase)

Peer Dependencies

  • @factoredui/core ^0.2.0
  • @supabase/supabase-js ^2.0.0
  • react ^18.0.0 || ^19.0.0

License

MIT