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

whitebox-pro-client-plugin-crm

v0.1.0

Published

WhiteBox browser client — CRM plugin: report client-observed facts (observations) about the current passport.

Readme

CRM Client Plugin

Report low-trust, client-observed facts about the current passport from the browser (UI events your app witnessed) — recorded as source: 'client' evidence, never authoritative state.

What it is

Report client-observed facts about the current passport from the browser — things your app witnessed in the UI:

import whitebox from 'whitebox-pro-client'
import crmPlugin from 'whitebox-pro-client-plugin-crm'

const wb = whitebox({
  url: 'https://api.example.com',
  plugins: [crmPlugin({ /* consent: 'marketing' */ })],
})

wb.crm.observe({ kind: 'onboarding_step', body: 'completed step 3' })
wb.crm.observe({ kind: 'cart', body: 'added 2 items to cart', meta: { count: 2 } })

What this is (and isn't)

These are low-trust observations, not authoritative state. WhiteBox is a semantic memory, not a system of record — observations are recorded as evidence tagged source: 'client' and weighed as self-reported by ask and the audiences evaluator. They don't need to be precise.

Authoritative state (subscription status, plan tier, CRM stage, billing) must come from your backend via the server-side /crm/records webhook — never the browser. A browser can't be trusted to assert "subscription: active", because that would feed answers and ad-audience membership.

How it sends

Mirrors the engagement plugin:

  • Socket-primarytransport.send('crm.observe', …); the server takes identity from the authenticated connection (the client can't report for another passport over the socket).
  • HTTP fallbackPOST /crm/observe with the current passport_id when the socket is down.
  • sendBeacon on pagehide / tab-hide so buffered observations aren't lost on unload.
  • Buffered + flushed by batchSize / flushIntervalMs.

Options

| option | default | meaning | |---|---|---| | consent | — (no gate) | consent category to gate on (e.g. 'marketing'). When set, observe() drops unless that category is granted. Set this for compliance. | | batchSize | 10 | flush when this many observations are buffered | | flushIntervalMs | 3000 | flush a non-full buffer after this long |

API

wb.crm.observe({ kind, body, id?, ts?, meta? }) — record one observation (kind + body required; id auto-generated if omitted). wb.crm.flush() — force-send the buffer.

Server side: enable whitebox-pro-server-plugin-crm, which records observations into awareness as channel:'crm', direction:'observation', source:'client'.