/** * In Native, we need to check if the SDK has been initialized, and if so, throw an error. * This is to prevent the SDK from being initialized multiple times. * * We need to dynamic import the modules, if not, it will be bundled into the SDK and be invoked immediately. */ export {}; const JOLIBOX_IMPLEMENT_INIT = Symbol.for('JOLIBOX_IMPLEMENT_INIT'); declare global { interface Window { [JOLIBOX_IMPLEMENT_INIT]: boolean; } } if (window[JOLIBOX_IMPLEMENT_INIT]) { console.info('Jolibox Implement Already Initialized'); throw new Error('Jolibox Implement Already Initialized'); } window[JOLIBOX_IMPLEMENT_INIT] = true; (async () => { const [{ config }] = await Promise.all([ import('./native/bootstrap'), import('./native/api'), import('./native/report') ]); config(); })();