kanmi-perf-revenue
v1.4.0 · MIT License (Free)
Revenue intelligence for web performance. Measures actual conversion rates at each performance bucket from your session data. No assumed coefficients — just empirical data.
No "0.5% CVR per 100ms" guesses. This tool measures the actual conversion rates at each performance bucket from YOUR session data.
Install
npm install kanmi-perf-revenue
Quick Start
CLI
# Demo with mock data
npx kanmi-perf-revenue --demo
# From CSV/JSON file
npx kanmi-perf-revenue --file sessions.csv --client "Acme Corp"
# From Datadog RUM
DD_API_KEY=xxx DD_APP_KEY=xxx npx kanmi-perf-revenue --start 2026-01-01 --end 2026-01-14
Library
import { analyzeFromFile, analyzeWithDatadog } from 'kanmi-perf-revenue';
// From CSV/JSON
const result = analyzeFromFile({
filePath: './sessions.csv',
clientName: 'Acme Corp',
});
// From Datadog RUM
const result = await analyzeWithDatadog({
apiKey: process.env.DD_API_KEY,
appKey: process.env.DD_APP_KEY,
startDate: '2026-01-01',
endDate: '2026-01-14',
});
console.log(result.report);
console.log(`Top opportunity: $${result.topOpportunity?.monthlyRevenue}/month`);
What It Produces
Empirical Conversion Curves
Actual CVR measured at each performance bucket:
| LCP Range | Sessions | CVR | Revenue |
|---|---|---|---|
| 0.0s-1.0s | 1,852 | 3.67% | $8K |
| 1.0s-1.5s | 12,339 | 2.79% | $40K |
| 2.0s-2.5s | 13,684 | 2.22% | $37K |
| 3.0s+ | 420 | 1.40% | $500 |
Revenue Opportunity
Prioritized by potential monthly revenue gain:
Top Opportunity: LCP
37% of sessions have LCP > 2.5s
These sessions convert 18.5% worse than faster sessions
Monthly revenue opportunity: $10K/month
Data Input
CSV/JSON Format
Required fields: session_id, converted (or has_purchase)
Optional: lcp_ms, inp_ms, cls, fcp_ms, ttfb_ms, order_value, device, page_type
session_id,lcp_ms,converted,order_value,device
abc123,1200,1,89.99,mobile
def456,3500,0,0,desktop
Features
| Feature | Description |
|---|---|
| 8 Performance Metrics | LCP, FCP, INP, CLS, TTFB, TTI, Onload, Page Size |
| Segmentation | Device, page type, geography, traffic source |
| Statistical Significance | Confidence intervals, p-values, effect sizes |
| ROI Calculator | Engineering effort vs expected revenue gain |
| Forecasting | 12-month revenue projections |
| A/B Test Integration | Compare performance variants statistically |
| Export Formats | JSON, CSV, Slack blocks, HTML email |
CLI Reference
kanmi-perf-revenue [options]
Data Sources:
--file PATH Import from CSV or JSON file
--demo Run with mock data (for testing)
--api-key KEY Datadog API key (or set DD_API_KEY)
--app-key KEY Datadog App key (or set DD_APP_KEY)
Options:
--start DATE Start date (YYYY-MM-DD)
--end DATE End date (YYYY-MM-DD)
--client NAME Client name for report header
--save Save analysis to history
--compare Compare to baseline
--help, -h Show help
How It Works
- Bucket sessions by performance — Group by performance ranges (e.g., 0-1s, 1-2s LCP)
- Measure actual CVR per bucket — Calculate conversion rate from your real data
- Calculate opportunity — If slow sessions performed like fast ones, how many more conversions?
- Prioritize by revenue impact — Rank metrics by potential monthly revenue gain
Requirements
- Node.js 18+
- Session data with performance metrics and conversion flags
- Datadog API/App keys (for RUM integration)