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

journey-mapper-tracker

v1.0.0

Published

Track user page flows and capture screenshots for UX research - Journey Mapper SDK

Readme

Journey Mapper Tracker SDK

Track user page flows and capture screenshots automatically for UX research and analysis.

Installation

npm install journey-mapper-tracker

Quick Start

import { JourneyTracker } from 'journey-mapper-tracker';

// Initialize the tracker
JourneyTracker.init({
  apiKey: 'jm_your_api_key_here',
  endpoint: 'https://your-journey-mapper-instance.com', // optional
  captureDelay: 1000, // optional, ms to wait after navigation
  excludedRoutes: ['/admin/*', '/login'], // optional
  debug: false, // optional
});

// Manually capture a page (optional)
await JourneyTracker.capture();

// Stop tracking when done
JourneyTracker.stop();

React/Next.js Integration

Option 1: Use the Provider Component

// components/JourneyTrackerProvider.tsx
"use client";

import { useEffect } from "react";
import { JourneyTracker } from "journey-mapper-tracker";

export function JourneyTrackerProvider({ 
  apiKey, 
  children 
}: { 
  apiKey: string; 
  children: React.ReactNode;
}) {
  useEffect(() => {
    JourneyTracker.init({
      apiKey,
      endpoint: window.location.origin,
      debug: process.env.NODE_ENV === 'development',
    });

    return () => {
      JourneyTracker.stop();
    };
  }, [apiKey]);

  return <>{children}</>;
}

Option 2: Initialize in Layout

// app/layout.tsx (Next.js 13+)
"use client";

import { useEffect } from 'react';
import { JourneyTracker } from 'journey-mapper-tracker';

export default function RootLayout({ children }) {
  useEffect(() => {
    JourneyTracker.init({
      apiKey: process.env.NEXT_PUBLIC_JOURNEY_MAPPER_KEY!,
      debug: true,
    });
  }, []);

  return (
    <html>
      <body>{children}</body>
    </html>
  );
}

Configuration Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | apiKey | string | required | Your project API key from Journey Mapper | | endpoint | string | window.location.origin | Your Journey Mapper server URL | | captureDelay | number | 1000 | Milliseconds to wait after navigation before capturing | | excludedRoutes | string[] | [] | Routes to skip (supports wildcards like /admin/*) | | debug | boolean | false | Enable console logging for debugging |

API Reference

JourneyTracker.init(config)

Initialize and start tracking. Must be called before any other methods.

JourneyTracker.stop()

Stop tracking and complete the current session. Call this when unmounting or when you want to end the session.

JourneyTracker.capture()

Manually capture the current page. Useful for capturing state after user interactions that don't trigger navigation.

JourneyTracker.isInitialized()

Returns true if the tracker is initialized and running.

How It Works

  1. Automatic Detection: The SDK detects page navigations (including SPA navigation via pushState/replaceState)
  2. Screenshot Capture: Uses html2canvas to capture full-page screenshots
  3. Data Upload: Sends captured data to your Journey Mapper instance
  4. Session Management: Groups all captured pages into a session for easy analysis

Requirements

  • Browser environment (not compatible with SSR/Node.js)
  • React 17+ (optional - works with any framework)

License

MIT