UNPKG

telex-amp

Version:

Lightweight React Native tracking library for performance and error logging with Telex Webhooks

19 lines (15 loc) 491 B
import { trackPerformance, trackError, trackComponentLifecycle, setTelexConfig } from "telex-tracker"; // Set webhook dynamically setTelexConfig({ webhook_url: "https://your-telex-webhook.com" }); // Track Performance const fetchData = async () => { const stopTracking = trackPerformance("fetchData"); await fetch("https://api.example.com/data"); stopTracking(); }; // Track Error try { throw new Error("Something went wrong!"); } catch (error) { trackError(error); }