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

@metrone-io/sdk

v1.4.3

Published

Metrone - Privacy-first analytics SDK with retry logic and AI tracking

Readme

@metrone-io/sdk

Privacy-first browser analytics SDK for Metrone.

Lightweight tracking with automatic pageviews, custom events, conversions, AI interaction tracking, batching, retries, and DNT/consent support. No HTTP cookies — uses sessionStorage for session continuity and optionally reads localStorage for consent state.

Install

npm install @metrone-io/sdk

Usage

import { Metrone } from '@metrone-io/sdk'

const analytics = new Metrone({
  apiKey: 'metrone_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  endpoint: '/api/analytics/events'
})

analytics.pageview()
analytics.track('button_click', { button_id: 'cta' })
analytics.conversion('purchase', 49.99)

Script tag

<script src="https://your-domain.com/js/metrone.js"></script>
<script>
  var analytics = new Metrone({
    apiKey: 'metrone_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
    endpoint: '/api/analytics/events'
  })
</script>

AI Tracking

analytics.trackAICall({ call_id: 'call_123', provider: 'vapi', duration: 45 })
analytics.trackAIChat({ session_id: 'sess_456', provider: 'intercom', message_count: 8 })
analytics.trackAIIntent({ intent: 'book_appointment', confidence: 0.92, source: 'voice' })
analytics.trackAISession({ session_id: 'sess_456', action: 'end', duration: 120 })

Zero-Code Click Tracking

<button data-track="cta_hero">Get Started</button>
<a href="/pricing" data-track="nav_pricing">Pricing</a>

Human vs AI traffic

Every event this SDK sends is classified at ingest as human or AI, with no configuration needed:

  • Humans clicking through from AI platforms (ChatGPT, Gemini, Perplexity, Claude, Copilot, …) are detected automatically from the referrer/UTM and grouped under one canonical AI source on the Metrone AI Traffic dashboard.
  • AI agents themselves (GPTBot, ChatGPT-User, PerplexityBot, …) never execute JavaScript, so no browser SDK can see them. Capture those with @metrone-io/server's agent middleware or the agent-edge Cloudflare Worker — this SDK keeps handling your human visitors.

Features

  • No HTTP cookies — uses sessionStorage for sessions, no cross-site tracking
  • Automatic SPA route tracking
  • Automatic outbound link, tel:, mailto:, and download click tracking
  • Zero-code click tracking via data-track attribute
  • AI voice call, chat, intent, and session tracking
  • Event batching with sendBeacon flush on page unload
  • Retry logic with exponential backoff
  • Idempotency keys to prevent duplicate events
  • DNT and consent mode support
  • Automatic human vs AI traffic classification at ingest (AI Traffic dashboard)
  • CJS + ESM + IIFE builds

Documentation

metrone.io/docs

License

MIT