@loggifycloud/browser
v0.1.3
Published
Loggify browser SDK - product analytics, RUM, and client errors
Readme
@loggifycloud/browser
Documentation: https://loggify.cloud/docs
First-party browser SDK for Mixpanel-like product analytics and Sentry-style RUM.
import { loggify } from '@loggifycloud/browser';
loggify.init({
apiKey: import.meta.env.VITE_LOGGIFY_KEY,
endpoint: 'https://ingest.loggify.cloud',
service: 'web-app',
environment: 'production',
release: '1.4.2',
autocapture: true,
});
loggify.register({ app: 'web' });
loggify.identify('user_123', { email: '[email protected]' });
loggify.people.set({ plan: 'pro' });
loggify.people.setOnce({ plan: 'starter' }); // skipped if plan already set
loggify.timeEvent('Checkout');
loggify.track('Checkout', { item: 'pro' }); // includes $duration and super properties
loggify.reset(); // logout — new anonymous distinct id
loggify.optOut(); // stop sendingAutomatic:
$pageview/$pageleave, SPApushState/popstate- Super properties (
register/registerOnce/unregister) on everytrack - People profile snapshot on every event (
people.set/setOnce/increment) - UTM, referrer, device / OS / browser, session id
- Optional click / submit autocapture (passwords redacted, values truncated)
errorandunhandledrejection→ existing errors pipelinefetch/ XHR client spans withtraceparent- Web Vitals LCP, INP, CLS, TTFB, FCP as metrics
- Failed ingest posts are retried on the next flush
