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

ribby-sdk

v0.1.2

Published

Analytics, Web Vitals tracking, and QA tools for React, Next.js, and Vite apps

Readme

ribby

Lightweight analytics and Web Vitals tracking for React, Next.js, Vite, and any JavaScript app.

Installation

npm install ribby-sdk
# or
yarn add ribby
# or
pnpm add ribby

React / Vite

// src/main.tsx or src/App.tsx
import { RibbyAnalytics } from 'ribby-sdk/react'

function App() {
  return (
    <>
      <RibbyAnalytics siteKey="YOUR_SITE_KEY" />
      {/* rest of your app */}
    </>
  )
}

Next.js (App Router)

// app/layout.tsx
import { RibbyAnalytics } from 'ribby-sdk/next'

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

Next.js (Pages Router)

// pages/_app.tsx
import { RibbyAnalytics } from 'ribby-sdk/next'
import type { AppProps } from 'next/app'

export default function App({ Component, pageProps }: AppProps) {
  return (
    <>
      <RibbyAnalytics siteKey="YOUR_SITE_KEY" />
      <Component {...pageProps} />
    </>
  )
}

Vanilla JS / HTML (no bundler)

<script>
  window.ribby = { q: [] };
  window.ribby.init = (c) => window.ribby.q.push(['init', c]);
  window.ribby.track = (e, p) => window.ribby.q.push(['track', e, p]);
</script>
<script defer src="https://cdn.ribby.app/analytics.js" data-site-key="YOUR_SITE_KEY"></script>

Tracking custom events

import { track } from 'ribby-sdk/react'
// or from 'ribby-sdk/next'
// or from 'ribby'

// Track a button click
track('signup_click', { plan: 'pro' })

// Track a purchase
track('purchase', { value: 49.99, currency: 'USD' })

Or use the hook:

import { useRibby } from 'ribby-sdk/react'

function SignUpButton() {
  const { track } = useRibby()

  return (
    <button onClick={() => track('signup_click', { plan: 'pro' })}>
      Sign up
    </button>
  )
}

Configuration

<RibbyAnalytics
  siteKey="YOUR_SITE_KEY"  // required — from your Ribby dashboard
  vitals={true}             // collect Web Vitals (LCP, FID, CLS, TTFB, FCP). default: true
  disabled={false}          // disable tracking entirely. default: false
  trackHashChanges={true}   // track hash-based SPA navigation. default: true
/>

What gets tracked

| Data | Description | |---|---| | Page URL | Current page path (no query strings with sensitive data) | | Referrer | Where the visitor came from | | Device type | Desktop / Mobile / Tablet | | Browser | Chrome / Safari / Firefox / Edge | | Session ID | Random ID per browser session (not stored server-side between sessions) | | Web Vitals | LCP, FID, CLS, TTFB, FCP — only if vitals={true} |

No cookies are set. Sessions use sessionStorage which clears when the tab closes.
Do Not Track is respected. If the visitor has DNT enabled, no data is sent.


Privacy

  • No cookies
  • No cross-site tracking
  • Respects Do Not Track
  • No personal data collected (no IPs stored, no fingerprinting)
  • GDPR-friendly by design

Your site key

Find your site key in the Ribby dashboard → Analytics → Setup.