UNPKG

overcentric

Version:

A lightweight, privacy-focused toolkit for modern SaaS web applications

30 lines (29 loc) 912 B
let loadPromise = null; export async function loadAutoCapture() { try { if (!loadPromise) { loadPromise = import('../autoCapture') .then(({ startAutoCapture }) => ({ startAutoCapture })) .catch(error => { loadPromise = null; throw new Error(`Failed to load auto-capture module: ${error.message}`); }); } return loadPromise; } catch (error) { loadPromise = null; throw error; } } export async function initAutoCapture(trackEvent, config) { try { const { startAutoCapture } = await loadAutoCapture(); startAutoCapture(trackEvent, config); console.log('Overcentric: Auto-capture initialized successfully'); } catch (error) { console.error('Overcentric: Failed to initialize auto-capture:', error); throw error; } }