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

@malleon/replay

v1.0.12

Published

A JavaScript SDK for capturing and replaying user interactions on web pages

Downloads

1,239

Readme

Replay SDK

A JavaScript SDK for capturing and replaying user interactions on web pages.

Compile

Dev

clear && npm run dist

Prod

clear && npm run dist:prod

Basic Usage

// Initialize replay for an app
initReplay('your-app-id');

// Add tags to the current replay
addTagToReplay('userType', 'premium', 'STR');
addTagToReplay('sessionId', 'abc123', 'STR');
addTagToReplay('isLoggedIn', true, 'BOOL');
addTagToReplay('loginTime', new Date(), 'DATETIME');
addTagToReplay('score', 95, 'NUM');

// Add multiple tags at once
addTagsToReplay([
  { name: 'browser', value: 'chrome', type: 'STR' },
  { name: 'device', value: 'desktop', type: 'STR' },
  { name: 'timestamp', value: new Date(), type: 'DATETIME' },
  { name: 'version', value: 2.1, type: 'NUM' }
]);

// Update user data for the replay
updateReplayUserData({
  userId: 'user123',
  username: 'john_doe',
  userEmail: '[email protected]',
  userRole: 'admin',
  userStatus: 'active'
});

API Reference

initReplay(appId: string): void

Initializes the replay system for the specified app ID. Must be called before using other functions.

addTagToReplay(name: string, value: string | number | boolean | Date, type: TagType): Promise<void>

Adds a single tag to the current replay. The type parameter is required and must match one of the supported tag types.

addTagsToReplay(tags: ReplayTag[]): Promise<void>

Adds multiple tags to the current replay at once. Each tag must include a name, value, and type.

updateReplayUserData(userData: ReplayUserData): Promise<void>

Updates user metadata for the current replay. All fields are optional.

Types and Interfaces

All types and interfaces are exported from ./types/replay-types and can be imported for use in TypeScript projects:

import { TagType, ReplayTag, ReplayUserData } from './types/replay-types';

TagType

type TagType = 'STR' | 'LARGE_STR' | 'NUM' | 'DATETIME' | 'BOOL';

ReplayTag

interface ReplayTag {
  name: string;
  value: string | number | boolean | Date;
  type: TagType;
}

ReplayUserData

interface ReplayUserData {
  userId?: string;
  username?: string;
  userEmail?: string;
  userRole?: string;
  userStatus?: string;
}

Tag Types

The following tag types are supported:

  • 'STR' - Short string values
  • 'LARGE_STR' - Long string values
  • 'NUM' - Numeric values
  • 'DATETIME' - Date and time values
  • 'BOOL' - Boolean values (true/false)

Note: The ReplayTag interface now uses name instead of key to match the backend TagInput class exactly, eliminating the need for field mapping.

Requirements

  • Must call initReplay() first to initialize the replay system
  • Functions will warn if called before initialization
  • All functions are asynchronous and return promises
  • Functions are also available globally on the window object
  • Tag functions require a type parameter to specify the data type