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 🙏

© 2025 – Pkg Stats / Ryan Hefner

humanbehavior-js

v0.5.61

Published

SDK for HumanBehavior session and event recording

Readme

HumanBehavior JS - Modular Edition

This is the modular version of the HumanBehavior JavaScript SDK, organized into separate packages for better maintainability and tree-shaking.

Quick Start

Simple Installation (Recommended)

The easiest way to get started is with the main package:

npm install humanbehavior-js

This gives you everything you need to start recording user sessions and events. The package automatically includes:

  • Core session recording functionality
  • Automatic event tracking
  • User identification
  • Data redaction
  • Session persistence

Basic Usage

import { HumanBehaviorTracker } from 'humanbehavior-js';

const tracker = HumanBehaviorTracker.init('your-api-key');
tracker.start();

Package Structure

Main Package

  • humanbehavior-js - Complete SDK with all features (recommended for most users)

Framework Integrations (Optional)

These packages provide framework-specific optimizations and are completely optional:

  • @humanbehavior/react - React hooks and context (or use humanbehavior-js/react)
  • @humanbehavior/vue - Vue.js plugin (or use humanbehavior-js/vue)
  • @humanbehavior/svelte - Svelte integration (or use humanbehavior-js/svelte)
  • @humanbehavior/remix - Remix.js integration (or use humanbehavior-js/remix)
  • @humanbehavior/angular - Angular integration (or use humanbehavior-js/angular)

Advanced Packages

  • @humanbehavior/core - Core SDK functionality (for advanced users)
  • @humanbehavior/wizard - Installation wizard and CLI tools

Installation Options

Option 1: Single Package (Simplest)

npm install humanbehavior-js

Then import framework features as needed:

// Core functionality
import { HumanBehaviorTracker } from 'humanbehavior-js';

// React features (if needed)
import { useHumanBehavior } from 'humanbehavior-js/react';

// Vue features (if needed)
import { HumanBehaviorPlugin } from 'humanbehavior-js/vue';

Option 2: Framework-Specific Packages

If you prefer separate packages for better tree-shaking:

# React
npm install @humanbehavior/react

# Vue
npm install @humanbehavior/vue

# Svelte
npm install @humanbehavior/svelte

# Remix
npm install @humanbehavior/remix

# Angular
npm install @humanbehavior/angular

Usage Examples

Basic Usage (Vanilla JS)

import { HumanBehaviorTracker } from 'humanbehavior-js';

const tracker = HumanBehaviorTracker.init('your-api-key');
tracker.start();

React Integration

import { useHumanBehavior } from 'humanbehavior-js/react';

function MyComponent() {
  const tracker = useHumanBehavior();
  
  const handleClick = () => {
    tracker.customEvent('button_clicked');
  };

  return <button onClick={handleClick}>Click me</button>;
}

Vue Integration

import { createApp } from 'vue';
import { HumanBehaviorPlugin } from 'humanbehavior-js/vue';

const app = createApp(App);
app.use(HumanBehaviorPlugin, {
  apiKey: 'your-api-key'
});

Svelte Integration

import { humanBehaviorStore } from 'humanbehavior-js/svelte';

const tracker = humanBehaviorStore.init('your-api-key');

Development

Setup

npm install

Build all packages

npm run build

Build specific package

npm run build --workspace=@humanbehavior/core

Development mode

npm run dev

Architecture

This modular structure provides several benefits:

  1. Simple Start: Install just humanbehavior-js and everything works
  2. Progressive Enhancement: Add framework-specific features as needed
  3. Tree-shaking: Only import what you need
  4. Framework-specific optimizations: Each framework package is optimized for its target
  5. Better maintainability: Clear separation of concerns
  6. Reduced bundle size: Smaller packages for specific use cases
  7. Easier testing: Isolated packages are easier to test

Migration from v1

The API remains the same, but the import paths have changed:

// Old
import { HumanBehaviorTracker } from 'humanbehavior-js';

// New - Same as before!
import { HumanBehaviorTracker } from 'humanbehavior-js';

// Or for framework-specific features
import { useHumanBehavior } from 'humanbehavior-js/react';

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

License

ISC