StreamRelay is a lightweight, self-hosted web monitoring and error-tracking solution. It provides developers with essential insights into their web application's performance (Core Web Vitals) and stability (JavaScript errors).
You can install StreamRelay using npm, pnpm, or yarn:
npm install streamrelaypnpm add streamrelayyarn add streamrelayHere's a basic example of how to initialize StreamRelay in your application:
import { init as StreamRelay } from "streamrelay";
const client = new StreamRelay({
release: "1.0.0",
environment: "production",
trackErrors: true,
trackWebVitals: true,
});
// Start monitoring
client.init();- Core Web Vitals: Automatically captures LCP (Largest Contentful Paint), FID (First Input Delay), and CLS (Cumulative Layout Shift) using the
web-vitalslibrary. - Error Tracking: Catches all unhandled JavaScript errors (
window.onerror) and unhandled promise rejections (window.onunhandledrejection). - User Breadcrumbs: Records a trail of user clicks and navigation events to provide context for debugging errors.
- Efficient Batching: Collects data in a queue and sends it to the backend in batches every 10-15 seconds to minimize network impact.
This project is licensed under the MIT License.