UNPKG

umami-analytics-react

Version:

React hooks (useUmami, useUmamiView) and UmamiProvider for seamless Umami analytics integration, supporting page views, custom event tracking, and session identification.

11 lines (10 loc) 242 B
export function tryUmami(umami, eventName, args) { if (!umami.current) return false; const fn = umami.current[eventName]; if (typeof fn === "function") { fn(...args); return true; } return false; }