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

@hrnt/ecosystem-core

v0.5.2

Published

Cross-site behavioral science and analytics engine for the HRNT ecosystem

Downloads

1,234

Readme

@hrnt/ecosystem-core

Cross-site behavioral science and analytics engine for the HRNT ecosystem.

Overview

This package provides a unified system for tracking visitor behavior across all HRNT sites (Portfolio, Shop, Bio, Docs, Booking) with:

  • Cross-domain visitor identity (shared cookies across .irakozehornet.com)
  • 7-segment visitor classification including Wildcard detection
  • GDPR-compliant consent management
  • Unified event tracking across all sites
  • Behavioral science patterns (exit intent, social proof, etc.)

Installation

npm install @hrnt/ecosystem-core

Quick Start

Basic Setup

import { EcosystemIdentity, SegmentEngine, EcosystemTracker, ConsentManager } from '@hrnt/ecosystem-core';

// 1. Initialize visitor identity
const identity = new EcosystemIdentity('portfolio');
const visitor = identity.init();

// 2. Set up consent
const consent = createConsentManager('portfolio');

// 3. Initialize tracker
const tracker = new EcosystemTracker({
  site: 'portfolio',
  endpoint: 'https://api.irakozehornet.com/analytics'
});
tracker.setVisitor(visitor);

// 4. Set up segmentation
const segmentEngine = new SegmentEngine();
segmentEngine.onSegmentChange((from, to, confidence) => {
  console.log(`Visitor changed from ${from} to ${to} (${confidence} confidence)`);
});

// 5. Track events
tracker.pageView();
tracker.click('hero-cta');

Visitor Segmentation

The system classifies visitors into 7 segments:

| Segment | Detection | Purpose | |---------|-----------|---------| | New | First visit | Welcome flow | | Brand | Views /partnerships, /media-kit, 90s+ engagement | Sponsorship pipeline | | Buyer | Shop product views, cart, purchase | Conversion optimization | | Reader | Blog dwell, newsletter signup | Content engagement | | Fan | 3+ sites visited, returns frequently | Community building | | Client | Booking views, service pages | Consultation funnel | | Creator | Resource downloads, LUT views | Free → paid conversion | | Wildcard | Low engagement, no conversions, returns | Capture & remarketing |

Wildcard Detection Algorithm

Wildcards are detected using a 35+ point scoring system:

// Signals (max 100 points)
- Low time on site (<30s): 15 points
- Low scroll depth (<25%): 10 points
- Single page session: 10 points
- No clicks: 5 points
- No conversions: 15 points
- Returns without converting: 15 points
- No form interactions: 10 points
- Direct traffic: 10 points
- Forum referrer: 10 points

// Classification
if (score >= 35) segment = 'wildcard';

GDPR Compliance

Consent Categories

  • Essential: Always enabled (site function)
  • Analytics: Visitor tracking, page views
  • Personalization: Recommendations, segmentation
  • Marketing: Retargeting, email capture

Usage

const consent = createConsentManager('portfolio');

// Check permissions
if (consent.canTrackAnalytics()) {
  tracker.pageView();
}

if (consent.canCaptureWildcard()) {
  showWildcardCaptureModal();
}

// Give consent
consent.giveConsent({ analytics: true, personalization: true });
consent.acceptAll();
consent.rejectAll();

// Withdraw
consent.withdrawConsent();

Cross-Domain Tracking

All sites share cookies on .irakozehornet.com:

  • hrnt_vid: Visitor ID (38 months)
  • hrnt_sid: Session ID (30 minutes, sliding)
  • hrnt_consent: GDPR consent (365 days)

This enables:

  • Single visitor identity across sites
  • Cross-site journey tracking
  • Unified segmentation

API Reference

EcosystemIdentity

const identity = new EcosystemIdentity(site, options);
identity.init(); // Initialize and get visitor
identity.getIdentity(); // Get current identity
identity.isNewVisitor(); // Check if first visit
identity.isReturning(); // Check if returning

SegmentEngine

const engine = new SegmentEngine(signals, crossSiteData);
engine.updateSignals({ timeOnSite: 45 });
engine.detect(currentUrl); // Get segment
engine.onSegmentChange(callback);

EcosystemTracker

const tracker = new EcosystemTracker(config);
tracker.setVisitor(visitor);
tracker.track('event_type', properties);
tracker.pageView();
tracker.click('target');
tracker.conversion('purchase', 99.99);
tracker.wildcardCapture('email');

ConsentManager

const consent = createConsentManager(site);
consent.hasConsent();
consent.hasCategoryConsent('analytics');
consent.canTrackAnalytics();
consent.canPersonalize();
consent.canMarket();
consent.canCaptureWildcard();
consent.giveConsent({ analytics: true });
consent.acceptAll();
consent.rejectAll();
consent.withdrawConsent();

Events

Standard event types:

  • page_view, scroll_depth
  • click, hover, focus
  • product_view, cart_add, purchase
  • article_view, download, resource_access
  • partnership_view, media_kit_download
  • booking_start, booking_complete
  • email_capture, exit_intent_shown
  • wildcard_detected, wildcard_capture
  • segment_change, cross_site_nav

Database Schema

See migrations/001_initial_schema.sql for Supabase schema.

Key tables:

  • ecosystem_visitors: Core identity
  • ecosystem_sessions: Cross-site sessions
  • ecosystem_events: Raw event stream
  • ecosystem_journeys: Journey attribution
  • ecosystem_consent: GDPR consent records

Data Retention

Per GDPR best practices:

| Data | Retention | Notes | |------|-----------|-------| | Raw events | 26 months | Google Analytics standard | | Sessions | 26 months | Attribution analysis | | Visitors | 38 months | Facebook-style extended | | Consent | 7 years | Legal requirement | | Aggregates | Indefinite | Anonymized |

License

MIT