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

billdogeng-react

v1.0.0-beta.1

Published

BilldogEng SDK for React — idiomatic, SSR-safe React wrapper over the BillDog engagement suite (analytics, surveys, in-app messaging, remote feature flags).

Readme

billdogeng-react

The BillDog engagement suite for React — a thin, idiomatic, SSR-safe wrapper over the existing browser SDKs (@billdog.io/web, @billdog.io/analytics, @billdog.io/survey-core).

It surfaces, framework-idiomatically:

  • Analyticscapture / identify / group via useBilldog()
  • Surveys — fetch + submit + a drop-in <Survey/> component (useSurvey)
  • In-app messaging — trigger via useBilldog().showInAppMessages()
  • Feature flagsremote / server-authoritative via useFeatureFlag()

Feature flags are evaluated on the BillDog backend. This package performs no local bucketing and contains no murmurhash — server-authoritative targeting only, by design.

Install

npm install billdogeng-react @billdog.io/web @billdog.io/analytics @billdog.io/survey-core

react / react-dom (>=18) and the three @billdog.io/* packages are peer dependencies. The @billdog.io/* peers are optional — features degrade to no-ops if a peer is absent.

Quick start

import { BilldogProvider } from 'billdogeng-react';

export function App() {
  return (
    <BilldogProvider config={{ apiKey: 'bd_live_…', projectId: 'proj_123' }}>
      <YourApp />
    </BilldogProvider>
  );
}

Analytics

import { useBilldog } from 'billdogeng-react';

function Checkout() {
  const { capture, identify, group } = useBilldog();

  function onLogin(user) {
    identify(user.id, { plan: user.plan });
    group('company', user.companyId, { seats: user.seats });
  }

  return <button onClick={() => capture('checkout_started')}>Buy</button>;
}

Feature flags (remote)

import { useFeatureFlag } from 'billdogeng-react';

function Banner() {
  const newUI = useFeatureFlag('new-banner', false);   // boolean flag
  const theme = useFeatureFlag('theme', 'classic');     // multivariate flag
  return newUI ? <NewBanner theme={theme} /> : <OldBanner />;
}

The value updates automatically whenever the SDK re-evaluates flags remotely.

Surveys

Drop-in component:

import { Survey } from 'billdogeng-react';

<Survey surveyId="svy_nps" onSubmit={(res) => console.log(res)} />;

Or drive the form yourself with the hook / render-prop:

import { useSurvey } from 'billdogeng-react';

function CustomSurvey() {
  const { survey, loading, submit } = useSurvey('svy_nps');
  if (loading || !survey) return null;
  // render your own UI, then call submit([...answers])
}

In-app messaging

const { showInAppMessages } = useBilldog();
showInAppMessages('home_banner');

SSR

The package is safe to import and server-render under SSR frameworks (Remix, Vite SSR, Astro islands, etc.):

  • The public entry never touches window/document at import time.
  • BilldogProvider only instantiates the engagement client inside useEffect, so nothing runs during server render. Children render immediately; engagement features activate once the provider becomes ready in the browser.
  • The underlying browser SDKs are loaded with dynamic import(), deferred to the client.

During SSR, useBilldog().ready is false and useFeatureFlag returns its default value.

API

| Export | Kind | Purpose | | --- | --- | --- | | BilldogProvider | component | Initialises the SDK; provides context. | | useBilldog() | hook | { client, ready, capture, identify, group, showInAppMessages, reset } | | useFeatureFlag(key, default?) | hook | Remote flag value (boolean or string variant). | | useSurvey(surveyId) | hook | { survey, loading, error, submit, refetch } | | Survey | component | Renders + submits a survey (or render-prop). | | createBilldogClient(config, deps?) | fn | Low-level client factory (client-side only). |

Development

npm install
npm run build      # tsup → dist/ (esm + cjs + d.ts)
npm test           # vitest (jsdom + node SSR suites)
npm run typecheck  # tsc --noEmit

License

MIT