NPMv0.6.0Node.js & BrowserMIT License

@junglans/trail

Unified Local-First Analytics, On-Page Heatmaps & Diagnostic Telemetry for React and Node.js

A unified enterprise-grade bundle combining both the React client SDK (@junglans/trail-react) and Node.js backend middleware (@junglans/trail-server). Store all customer and user telemetry inside your own SQLite database under /api/jungtrail with zero monthly SaaS fees, zero cloud leakage, and complete privacy compliance.

CAPABILITIES
104
MONTHLY SAAS COST
$0
STORAGE ENGINE
SQLite WAL
CLOUD LEAKAGE
0.00%

1. Installation

Install @junglans/trail using your favorite package manager. All dependencies are minimal and zero-leakage.

Install Command
npm install @junglans/trail

2. Quickstart & Implementation

Get up and running in less than 30 seconds. Copy and paste the code snippets below directly into your codebase.

Code Examples
import express from 'express';
import { jungtrailMiddleware } from '@junglans/trail/server';

const app = express();
app.use(express.json());

// Mount all 104 analytics, heatmap, e-commerce, and auth endpoints
app.use('/api/jungtrail', jungtrailMiddleware({
  dbName: 'analytics.db',
  dbPath: './data/analytics.db',
  adminKey: process.env.ADMIN_KEY || 'demo-admin-key',
}));

app.listen(3000, () => {
  console.log('Trail server running at http://localhost:3000/api/jungtrail');
});
File: server.jsjavascript

3. 104 Built-in Capabilities

@junglans/trail incorporates 10 modular feature categories directly into your app.

Core Tracking

27 features

Page views, Click tracking, Rage clicks, Dead clicks, Scroll funnels (25/50/75/100%), Time spent on page, Exit intent, Asset downloads, Clipboard copies, Web Vitals (LCP/CLS/FID/INP), UTM parameters, Device / OS / Browser breakdown, Referrer analytics, Viewport dimensions, Focus & Blur detection

Auth & Identity

18 features

Login success/failure rates, Registration funnels, Password reset flows, MFA verification audits, OAuth distribution, Role & privilege tracking, User pseudonym stitching, Session takeover detection, Brute-force velocity alerts

Session Lifecycle

17 features

Active concurrent sessions, Session duration, Bounce detection, Idle vs active time ratio, Multi-tab broadcast sync, Engagement tiers (Low/Med/High/Power), GDPR automated erasure, Inactivity timeouts

Heatmap & Spatial

7 features

Live canvas radial heatmap, Element click leaderboard, Target CSS selector tagging, Device viewport filtering, Dynamic container scroll recalculation, Scroll depth gradients, Heat intensity thresholds

Diagnostics & Performance

8 features

Unhandled JS error logging, Console capture, Network status & offline detection, Client diagnostics payload, Slow API call alerts, Memory threshold flags, DOM element leak detection, Rehydration mismatch logs

Database & Admin

7 features

SQLite WAL high-throughput engine, JSON / CSV bulk exports, Automatic DB backups, Admin key token authentication, Pruning retention policies, VACUUM optimization routines, Schema auto-migration

E-Commerce & Revenue

8 features

Product impressions, Add to cart, Remove from cart, Checkout funnel progression, Purchases & revenue tracking, Cart abandonment alerts, Discount coupon analytics, Refund logging

A/B Testing & Feature Flags

4 features

Experiment variant exposures, Variant conversion tracking, Feature flag evaluation logs, Statistical confidence calculators

Feedback, NPS & CSAT

4 features

NPS scoring (Promoters / Passives / Detractors), CSAT satisfaction surveys, In-app feedback notes, Sentiment tagging

Resilience & Latency

4 features

Client API latency benchmarking, Health check probes, IndexedDB offline queue persistence, Buffer overflow backpressure protection

Frequently Asked Questions