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

@walkeros/web-destination-hotjar

v4.0.2

Published

Hotjar web destination for walkerOS (session replay, heatmaps, surveys)

Readme

Hotjar Destination for walkerOS

Source CodeNPM PackageDocumentation

This package forwards walkerOS events to Hotjar - session recordings, heatmaps, surveys, and on-page feedback. Built on the official @hotjar/browser SDK.

walkerOS follows a source → collector → destination architecture. This Hotjar destination receives processed events from the walkerOS collector and forwards them as Hotjar events, identities, and SPA route notifications.

Features

  • Default event forwarding - every walkerOS event becomes Hotjar.event(name) with no additional config
  • Identity - Hotjar.identify(userId, attributes) with userId extracted from the resolved mapping value; remaining keys become user attributes
  • SPA state change - Hotjar.stateChange(path) for accurate heatmaps on virtual page views in single-page applications
  • Snippet injection - @hotjar/browser handles script loading, including CSP nonce and debug mode

Installation

npm install @walkeros/web-destination-hotjar

Quick Start

import { startFlow } from '@walkeros/collector';
import { destinationHotjar } from '@walkeros/web-destination-hotjar';

await startFlow({
  destinations: {
    hotjar: {
      code: destinationHotjar,
      config: {
        settings: {
          siteId: 1234567, // your Hotjar site ID
        },
      },
    },
  },
});

Configuration

Settings (destination-level)

| Name | Type | Description | Required | | --------------- | --------------- | ------------------------------------------------------------------------------------------------------ | -------- | | siteId | number | Hotjar site ID (numeric, from dashboard Settings) | Yes | | hotjarVersion | number | Hotjar snippet version. Defaults to 6. Override only if Hotjar releases a new version. | No | | debug | boolean | Enable Hotjar debug mode for development troubleshooting | No | | nonce | string | CSP nonce for the injected Hotjar script tag (required with strict Content-Security-Policy) | No | | identify | Mapping.Value | Destination-level identity mapping; resolves to { userId, ...attributes } for Hotjar.identify(...) | No |

Mapping (rule.settings)

| Name | Type | Description | | ------------- | --------------- | ------------------------------------------------------------------------------------------------------------ | | identify | Mapping.Value | Per-event identity override; resolves to { userId, ...attributes }Hotjar.identify(userId, attributes) | | stateChange | Mapping.Value | SPA route change; resolves to a relative path string → Hotjar.stateChange(path) |

Standard mapping features also apply:

  • name - rename the forwarded event (Hotjar.event(<new name>))
  • silent - suppress the default Hotjar.event(...) call while still running identify / stateChange
  • ignore - drop the event entirely (no calls produced)

Event Forwarding

Hotjar's event(actionName) API is name-only - no properties, no payload. The destination forwards the walkerOS event.name (e.g. "order complete") by default. Rename with mapping.name:

mapping: {
  order: {
    complete: {
      name: 'completed_purchase',
    },
  },
}

Identity

Hotjar recommends calling identify() on every page load so subsequent events are associated with the right user. Configure at the destination level:

settings: {
  siteId: 1234567,
  identify: {
    map: {
      userId: 'user.id',
      plan: 'user.plan',
    },
  },
}

The resolved object's userId becomes the first positional argument; every other key becomes a user attribute (Hotjar accepts string | number | boolean). Non-primitive values are skipped.

Per-event identity overrides destination-level identity via mapping.settings.identify.

SPA State Change

For single-page applications, fire Hotjar.stateChange(path) on route changes so heatmaps aggregate by virtual URL. Typical pattern: hook into your router and emit a walkerOS event:

mapping: {
  page: {
    view: {
      silent: true, // Suppress default Hotjar.event('page view')
      settings: {
        stateChange: 'data.id', // Resolves to the new path
      },
    },
  },
}

Consent

Hotjar has no runtime consent API. Consent is gated at the walkerOS level via config.consent:

destinations: {
  hotjar: {
    code: destinationHotjar,
    config: {
      consent: { marketing: true },
      settings: { siteId: 1234567 },
    },
  },
}

Unconsented events are blocked by the collector before reaching the destination.

Contribute

Feel free to contribute by submitting an issue, starting a discussion, or getting in contact.

License

This project is licensed under the MIT License.