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

@bufinance/events

v0.1.0

Published

OpenPanel analytics wrapper for BUFI apps: Provider + client track() + server setupAnalytics() + api-tracker + the canonical LogEvents registry. Ships TS source (consume via Next.js transpilePackages). Shared by desk-v1 and defi-web-app.

Readme

@bufinance/events

OpenPanel analytics wrapper for BUFI apps. Shared by desk-v1 and defi-web-app (fx). Extracted as a standalone, publishable package so multiple apps can install it from npm.

It provides:

  • A client <Provider/> (wraps OpenPanelComponent) for the root layout.
  • A client track({ event, ...props }) hook helper.
  • A server setupAnalytics() for server components / actions (identify + track).
  • An apiTracker for API routes (typed fintech volume events: transfers, ramps, payroll, KYC/KYB, fees, subscriptions, virtual accounts, cards, sessions, …).
  • The canonical LogEvents registry (event name + channel) plus analytics helper functions (getChannelSummary, searchEvents, funnel definitions, …).

Ships TypeScript source

This package ships .ts/.tsx source (no build step). Consumers transpile it via Next.js transpilePackages — same pattern as @bufinance/web3-signin.

Environment variables

| Var | Scope | Used by | |---|---|---| | NEXT_PUBLIC_OPENPANEL_CLIENT_ID | public (client + server) | Provider, setupAnalytics, apiTracker | | OPENPANEL_SECRET_KEY | server-only secret | setupAnalytics, apiTracker |

The client id is a NEXT_PUBLIC_* value, so Next.js inlines it at build time. The secret key is server-only and must never be exposed to the browser.

Install

npm install @bufinance/events
# or
bun add @bufinance/events

.npmrc

@bufinance/* packages publish to the public npm registry under the @bufinance scope. If your install needs an auth token (private registry / CI), configure it in .npmrcdo not commit the token. For example:

//registry.npmjs.org/:_authToken=${NPM_TOKEN}
@bufinance:registry=https://registry.npmjs.org

…and provide NPM_TOKEN via the environment.

Consume

1. Transpile the package

next.config.ts (or .js):

const nextConfig = {
  transpilePackages: ['@bufinance/events'],
};

export default nextConfig;

2. Render <Provider/> in the root layout

// app/layout.tsx
import { Provider as AnalyticsProvider } from '@bufinance/events/client';

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>
        {children}
        <AnalyticsProvider />
      </body>
    </html>
  );
}

3. Track events on the client

'use client';

import { track } from '@bufinance/events/client';

function PricingPage() {
  // fire when the pricing view is shown
  track({ event: 'pricing_viewed', channel: 'engagement', plan: 'pro' });
  return null;
}

4. Track on the server

import { setupAnalytics } from '@bufinance/events/server';

const analytics = await setupAnalytics({ userId, fullName });
analytics.track({ event: 'pricing_viewed', channel: 'engagement' });

5. Track volume events from API routes

import { apiTracker } from '@bufinance/events/api-tracker';

await apiTracker.trackTransfer('completed', {
  amount: 100,
  currency: 'USDC',
  user_id: userId,
});

Subpath exports

| Import | Contents | |---|---| | @bufinance/events | Provider, track, the full LogEvents registry + helpers (client-safe barrel) | | @bufinance/events/client | Provider, track | | @bufinance/events/server | setupAnalytics ('use server' — server-only) | | @bufinance/events/events | LogEvents + analytics helpers + types | | @bufinance/events/api-tracker | apiTracker, buildCohortTags, types (server-only) |

server.ts and api-tracker.ts are intentionally subpath-only and are NOT re-exported from the root barrel (server-only code must not leak into client bundles).