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

@chip-hosting/analytics

v2.0.2

Published

Marver Web SDK — first-party browser analytics for Chip Hosting (formerly Data Workbench). Event, page, and identity tracking with batching, consent, and auto-track plugins.

Downloads

287

Readme

Marver Web SDK

@chip-hosting/analytics

The Marver Web SDK — a lightweight, first-party browser analytics SDK for Marver, Chip Hosting's analytics platform (formerly Data Workbench). Capture page views, custom events, and user identity, batch them efficiently, and ship them to your own Sensor endpoint. No third-party cookies, consent-aware by design, ~tiny footprint.

  • First-party — events go to your endpoint, not a vendor's.
  • Batched + resilient — events queue, batch, and retry; flushed on beforeunload/pagehide.
  • Consent-aware — every event carries a consent category for server-side enforcement.
  • Auto-track plugins — page views (incl. SPA route changes), clicks, and form submits.
  • Zero-dependency, ESM + CDNimport it or drop a <script> tag.

Installation

npm install @chip-hosting/analytics

Quick start

ES modules / bundler

import dwb from '@chip-hosting/analytics';

dwb.init({
  endpoint: 'https://sensor.yourcompany.com',
  clientId: 'your-website',
});

dwb.page();                                       // track current page view
dwb.track('button_click', { buttonId: 'signup' }); // custom event
dwb.identify('user123', { email: '[email protected]' });

CDN / script tag

The SDK attaches itself to window.dwb when loaded via a script tag.

<script src="https://cdn.chip-hosting.com/marver/v1/dwb-analytics.min.js"></script>
<script>
  dwb.init({ endpoint: 'https://sensor.yourcompany.com', clientId: 'your-website' });
  dwb.page();
</script>

Configuration

dwb.init(config) accepts:

| Option | Type | Default | Description | |--------|------|---------|-------------| | endpoint | string | required | Sensor endpoint URL, e.g. https://sensor.yourcompany.com. | | clientId | string | required | Client / application identifier. | | cookieDomain | string | — | Cookie domain for the visitor ID, e.g. .yourcompany.com. | | batchSize | number | 5 | Events to batch before sending. | | flushInterval | number | 5000 | Auto-flush interval in ms. | | maxRetries | number | 3 | Max retry attempts for failed requests. | | debug | boolean | false | Enable debug logging. | | useProxy | boolean | false | Route through an Edge Function proxy instead of the Sensor directly. | | proxyEndpoint | string | — | Proxy URL (required when useProxy is true). | | autoCollect | AutoCollectConfig \| boolean | true | Auto-collect browser context per event (see below). | | autoTrack | AutoTrackConfig | { pageView: true, click: false, formSubmit: false } | Auto-track plugin toggles (see below). |

Auto-collected context (autoCollect)

When enabled (default), each event is enriched with context. Pass true/false to toggle all, or an object to enable categories individually: screen, browser, locale, utm, device, performance, network.

dwb.init({
  endpoint: '...',
  clientId: '...',
  autoCollect: { utm: true, device: true, performance: false },
});

Auto-track plugins (autoTrack)

| Plugin | Default | What it does | |--------|---------|--------------| | pageView | true | Tracks the initial page view plus SPA pushState/popstate route changes. | | click | false | Tracks clicks on elements matching selectors.click. | | formSubmit | false | Tracks submits on forms matching selectors.form. |

dwb.init({
  endpoint: '...',
  clientId: '...',
  autoTrack: {
    pageView: true,
    click: true,
    formSubmit: true,
    selectors: { click: '[data-track]', form: 'form.lead' },
  },
});

API

| Method | Description | |--------|-------------| | init(config) | Initialize the SDK. Must be called once before tracking. | | track(event, properties?) | Track a custom event with optional properties. | | page(path?) | Track a page view (defaults to the current path). | | identify(userId, traits?) | Associate the visitor with a known user. Traits: email, customerId, deviceId, phone, plus any custom string fields. | | reset() | Clear user identity (e.g. on logout). | | flush() | Manually flush the queued events. | | getVisitorId() | Current anonymous visitor ID. | | getSessionId() | Current session ID. | | getUserId() | Current identified user ID, if any. | | isInitialized() | Whether init() has run. | | destroy() | Tear down the instance and remove listeners. |

Consent

Events carry a consent category — analytics, marketing, personalization, or functional — so your Sensor can enforce consent server-side. Events default to the analytics category.

Advanced usage

For custom pipelines, the building blocks are exported directly:

import {
  Analytics,
  CookieManager,
  HttpTransport,
  EventQueue,
  ContextCollector,
  ClickTracker,
} from '@chip-hosting/analytics';

Type exports: DataWorkbenchConfig, IdentityTraits, EventProperties, IdentityPayload, AutoCollectConfig, AutoTrackConfig.

License

MIT