@overlayed/ads 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- function e(e,...t){console.error(`[Overlayed] ${e}`,...t)}function t(e,...t){console.info(`[Overlayed] ${e}`,...t)}function n(e){globalThis.reviq=globalThis.reviq||[],globalThis.reviq.push(e)}function r(e,t){return e(),setInterval(e,t)}function i(){return typeof window>`u`?!1:!(`__overlayed`in window)||!(`__overlayedRuntime`in window)||!window.__overlayed?.meta||!window.__overlayedRuntime?(e(`Could not find overlayed instance or runtime - did you import the preload script?`),!1):!0}function a(t,r){if(t===`app_id`){e(`[Overlayed] app_id is a reserved key`);return}n(e=>{e.setKv(t,r)})}function o(e,t){n(n=>{n.setKv(e,t)})}function s(t){if(t.app_id){e(`[Overlayed] app_id is a reserved key`);return}n(e=>{e.setKvs(t)})}function c(e){n(t=>{t.setAdsEnabled(e)})}function l(e){if(!i()||e.u){n(t=>{t.setUid(e)});return}let t=window.__overlayedRuntime;n(n=>{n.setUid({...e,u:t?.userId})})}function u(){n(e=>{e.showConsent()})}let d=null;function f(){d&&clearInterval(d),d=r(()=>{t(`[Overlayed] Attempting to intiailize ads...`),i()&&(d&&clearInterval(d),p())},1e3)}function p(){let{meta:e}=window.__overlayed,n=window.__overlayedRuntime;o(`app_id`,e.application.slug),l({u:n?.userId}),t(`[Overlayed] Ads initialized!`)}export{f as init,c as setAdsEnabled,a as setKv,s as setKvs,l as setUid,u as showConsent};
1
+ function e(e,...t){console.error(`[Overlayed] ${e}`,...t)}function t(e,...t){console.info(`[Overlayed] ${e}`,...t)}function n(e){globalThis.reviq=globalThis.reviq||[],globalThis.reviq.push(e)}function r(e,t){return e(),setInterval(e,t)}function i(){return typeof window>`u`?!1:!(`overlayed`in window)||!window.overlayed||!window.overlayed.getAppInfo?(e(`Could not find overlayed instance - did you import the preload script?`),!1):!0}function a(t,r){if(t===`app_id`){e(`[Overlayed] app_id is a reserved key`);return}n(e=>{e.setKv(t,r)})}function o(e,t){n(n=>{n.setKv(e,t)})}function s(t){if(t.app_id){e(`[Overlayed] app_id is a reserved key`);return}n(e=>{e.setKvs(t)})}function c(e){n(t=>{t.setAdsEnabled(e)})}function l(e){if(!i()||e.u){n(t=>{t.setUid(e)});return}window.overlayed.getAppInfo().then(t=>{n(n=>{n.setUid({...e,u:t.userId})})})}function u(){n(e=>{e.showConsent()})}let d=null;function f(){d&&clearInterval(d),d=r(()=>{t(`[Overlayed] Attempting to intiailize ads...`),i()&&(d&&clearInterval(d),p(window.overlayed))},1e3)}async function p(e){let n=await e.getAppInfo();o(`app_id`,n.slug),l({u:n.userId}),t(`[Overlayed] Ads initialized!`)}export{f as init,c as setAdsEnabled,a as setKv,s as setKvs,l as setUid,u as showConsent};
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@overlayed/ads",
3
3
  "author": "overlayed.gg",
4
4
  "homepage": "https://overlayed.gg",
5
- "version": "0.2.0",
5
+ "version": "0.2.1",
6
6
  "description": "Overlayed ads",
7
7
  "license": "SEE LICENSE IN LICENSE.md",
8
8
  "repository": {