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

@qurvo/sdk-browser

v0.0.13

Published

Browser SDK for Qurvo analytics — event tracking, user identification, auto-capture

Readme

@qurvo/sdk-browser

Browser SDK for Qurvo analytics. Lightweight client-side event tracking with automatic pageview capture, user identification, and reliable event delivery.

Installation

npm install @qurvo/sdk-browser
# or
pnpm add @qurvo/sdk-browser
# or
yarn add @qurvo/sdk-browser

CDN / Script Tag

Load the SDK directly via a <script> tag — no bundler required:

<script src="https://unpkg.com/@qurvo/sdk-browser@latest/dist/qurvo.iife.js"></script>
<script>
  qurvo.init({
    apiKey: 'qk_your_api_key',
    endpoint: 'https://ingest.yourapp.com',
  });
</script>

Pin a specific version for production:

<!-- unpkg -->
<script src="https://unpkg.com/@qurvo/[email protected]/dist/qurvo.iife.js"></script>

<!-- jsdelivr -->
<script src="https://cdn.jsdelivr.net/npm/@qurvo/[email protected]/dist/qurvo.iife.js"></script>

The IIFE build exposes a global qurvo object with the same API as the ES module.

Quick Start

import { qurvo } from '@qurvo/sdk-browser';

// Initialize with your project API key
qurvo.init({
  apiKey: 'qk_your_api_key',
  endpoint: 'https://ingest.yourapp.com',
});

// Track custom events
qurvo.track('button_click', { button: 'signup', page: '/pricing' });

// Identify a user after login
qurvo.identify('user-123', { email: '[email protected]', plan: 'pro' });

That's it. The SDK automatically tracks pageviews, collects browser context, and batches events for efficient delivery.

Configuration

qurvo.init({
  apiKey: 'qk_...',          // Required. Your project API key
  endpoint: 'https://...',   // Ingest API URL (default: http://localhost:3001)
  autocapture: true,         // Auto-track page navigation (default: true)
  flushInterval: 10000,      // Batch send interval in ms (default: 10000)
  flushSize: 10,             // Send batch when queue reaches this size (default: 10)
});

API

qurvo.init(config)

Initializes the SDK. Must be called before any other method. Safe to call multiple times (subsequent calls are ignored).

When autocapture is enabled (default), the SDK automatically:

  • Tracks an initial $pageview event
  • Monitors history.pushState and popstate for SPA navigation
  • Sends a $pageleave event and flushes the queue on page unload

qurvo.track(event, properties?)

Track a custom event.

qurvo.track('purchase', {
  product_id: 'prod_123',
  amount: 49.99,
  currency: 'USD',
});

qurvo.identify(userId, userProperties?)

Link the current anonymous user to a known user ID. Sends a $identify event that merges the anonymous session history with the identified user.

qurvo.identify('user-123', {
  email: '[email protected]',
  name: 'Jane Doe',
  plan: 'pro',
});

qurvo.page(properties?)

Manually track a pageview. Called automatically on initialization and SPA navigation when autocapture is enabled.

qurvo.page({ section: 'docs' });

qurvo.set(properties)

Set user properties. Overwrites existing values.

qurvo.set({ plan: 'enterprise', company: 'Acme Inc.' });

qurvo.setOnce(properties)

Set user properties only if they haven't been set before. Useful for first-touch attribution.

qurvo.setOnce({ referral_source: 'google', first_seen: new Date().toISOString() });

qurvo.reset()

Clear the current user identity and all stored IDs. Call this on logout.

qurvo.reset();

Automatic Context

Every event includes browser context collected automatically:

| Field | Example | |---|---| | session_id | a1b2c3d4-... (unique per tab) | | url | https://app.example.com/dashboard | | referrer | https://google.com | | page_title | Dashboard - My App | | page_path | /dashboard | | screen_width | 1920 | | screen_height | 1080 | | language | en-US | | timezone | America/New_York |

How It Works

  • Anonymous ID is generated on first visit and persisted in localStorage, so the same user is recognized across sessions.
  • Session ID is stored in sessionStorage, giving each tab its own session that ends when the tab closes.
  • Event queue batches events and sends them every 10 seconds or when the batch reaches 10 events.
  • Page unload triggers a final flush using keepalive fetch to ensure no events are lost.
  • Retry with backoff on network failures: 1s, 2s, 4s, 8s... up to 30s between retries.

Special Events

| Event | Trigger | |---|---| | $pageview | init(), SPA navigation (pushState, popstate) | | $pageleave | Page visibility change (hidden) or beforeunload | | $identify | identify() call | | $set | set() call | | $set_once | setOnce() call |

TypeScript

The package ships with full TypeScript type definitions.

import { qurvo, type BrowserSdkConfig } from '@qurvo/sdk-browser';

License

MIT