@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.
1. Installation
Install @junglans/trail using your favorite package manager. All dependencies are minimal and zero-leakage.
npm install @junglans/trail2. Quickstart & Implementation
Get up and running in less than 30 seconds. Copy and paste the code snippets below directly into your codebase.
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');
});3. 104 Built-in Capabilities
@junglans/trail incorporates 10 modular feature categories directly into your app.
Core Tracking
27 featuresPage 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 featuresLogin 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 featuresActive 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 featuresLive 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 featuresUnhandled 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 featuresSQLite 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 featuresProduct 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 featuresExperiment variant exposures, Variant conversion tracking, Feature flag evaluation logs, Statistical confidence calculators
Feedback, NPS & CSAT
4 featuresNPS scoring (Promoters / Passives / Detractors), CSAT satisfaction surveys, In-app feedback notes, Sentiment tagging
Resilience & Latency
4 featuresClient API latency benchmarking, Health check probes, IndexedDB offline queue persistence, Buffer overflow backpressure protection