@smoud/playable-sdk 1.1.2 → 1.1.3
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.
- package/README.md +3 -0
- package/defines.d.ts +3 -1
- package/dist/esm/index.js +21 -4
- package/dist/iife/index.js +21 -4
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +21 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -43,6 +43,7 @@ It's powerful, unified SDK that seamlessly integrates multiple ad network SDKs,
|
|
|
43
43
|
- Adikteev
|
|
44
44
|
- Bigabid
|
|
45
45
|
- inMobi
|
|
46
|
+
- Remerge
|
|
46
47
|
|
|
47
48
|
### Protocol Support
|
|
48
49
|
|
|
@@ -170,6 +171,7 @@ Supported **Ad Networks**:
|
|
|
170
171
|
- `adikteev`
|
|
171
172
|
- `bigabid`
|
|
172
173
|
- `inmobi`
|
|
174
|
+
- `remerge`
|
|
173
175
|
|
|
174
176
|
See more details in [`GitHub repository.`](https://github.com/smoudjs/playable-scripts?tab=readme-ov-file#installation)
|
|
175
177
|
|
|
@@ -352,6 +354,7 @@ sdk.off('eventName', [callback], [context]);
|
|
|
352
354
|
| `retry` | - | Retry/restart triggered | Reset game state |
|
|
353
355
|
| `finish` | - | Playable marked as complete | Show end screen |
|
|
354
356
|
| `install` | - | Install action triggered | Track conversion |
|
|
357
|
+
| `error` | `message, action` | Ad network protocol reported an error | Log/report failures |
|
|
355
358
|
|
|
356
359
|
### Properties
|
|
357
360
|
|
package/defines.d.ts
CHANGED
|
@@ -67,7 +67,8 @@ declare const AD_NETWORK:
|
|
|
67
67
|
| 'smadex'
|
|
68
68
|
| 'adikteev'
|
|
69
69
|
| 'bigabid'
|
|
70
|
-
| 'inmobi'
|
|
70
|
+
| 'inmobi'
|
|
71
|
+
| 'remerge';
|
|
71
72
|
|
|
72
73
|
declare const AD_PROTOCOL: 'mraid' | 'dapi' | 'nucleo' | 'none';
|
|
73
74
|
declare const GOOGLE_PLAY_URL: string;
|
|
@@ -97,6 +98,7 @@ interface Window {
|
|
|
97
98
|
|
|
98
99
|
BIGABID_BIDTIMEMACROS?: Record<string, string>
|
|
99
100
|
INMOBI_DSPMACROS?: Record<string, string>
|
|
101
|
+
REMERGE_BIDTIMEMACROS?: Record<string, string>
|
|
100
102
|
|
|
101
103
|
openAppStore: Function;
|
|
102
104
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -128,7 +128,7 @@ function ensureProtocol() {
|
|
|
128
128
|
|
|
129
129
|
// src/tracking.ts
|
|
130
130
|
function initTrackingProtocols() {
|
|
131
|
-
if (AD_NETWORK === "bigabid" || AD_NETWORK === "inmobi") {
|
|
131
|
+
if (AD_NETWORK === "bigabid" || AD_NETWORK === "inmobi" || AD_NETWORK === "remerge") {
|
|
132
132
|
let trackURL2 = function(url) {
|
|
133
133
|
if (url) {
|
|
134
134
|
const trackingPixel = new Image();
|
|
@@ -172,6 +172,22 @@ function initTrackingProtocols() {
|
|
|
172
172
|
setTimeout(() => trackInMobiEvent2("Spent_25_Seconds"), 25e3);
|
|
173
173
|
setTimeout(() => trackInMobiEvent2("Spent_30_Seconds"), 3e4);
|
|
174
174
|
});
|
|
175
|
+
} else if (AD_NETWORK === "remerge") {
|
|
176
|
+
let trackRemergeEvent2 = function(event) {
|
|
177
|
+
if (window.REMERGE_BIDTIMEMACROS && window.REMERGE_BIDTIMEMACROS[event])
|
|
178
|
+
trackURL2(window.REMERGE_BIDTIMEMACROS[event]);
|
|
179
|
+
};
|
|
180
|
+
var trackRemergeEvent = trackRemergeEvent2;
|
|
181
|
+
sdk.once("boot", () => trackRemergeEvent2("ready"));
|
|
182
|
+
sdk.once("start", () => trackRemergeEvent2("impression"));
|
|
183
|
+
sdk.once("interaction", () => trackRemergeEvent2("engagement"));
|
|
184
|
+
sdk.once("install", () => trackRemergeEvent2("click"));
|
|
185
|
+
sdk.on("error", (message, action) => {
|
|
186
|
+
if (window.REMERGE_BIDTIMEMACROS && window.REMERGE_BIDTIMEMACROS.error)
|
|
187
|
+
trackURL2(
|
|
188
|
+
window.REMERGE_BIDTIMEMACROS.error.replace(/\{DOMAIN\}/g, encodeURIComponent(action || "")).replace(/\{ERR_MSG\}/g, encodeURIComponent(message || ""))
|
|
189
|
+
);
|
|
190
|
+
});
|
|
175
191
|
}
|
|
176
192
|
}
|
|
177
193
|
}
|
|
@@ -265,8 +281,9 @@ function startMraidProtocol() {
|
|
|
265
281
|
}
|
|
266
282
|
}
|
|
267
283
|
});
|
|
268
|
-
mraid.addEventListener("error", function(
|
|
269
|
-
console.log("mraid error: " +
|
|
284
|
+
mraid.addEventListener("error", function(message, action) {
|
|
285
|
+
console.log("mraid error: " + message + " action: " + action);
|
|
286
|
+
emitEvent("error", message, action);
|
|
270
287
|
});
|
|
271
288
|
if (AD_NETWORK === "unity") {
|
|
272
289
|
window.addEventListener("resize", function() {
|
|
@@ -657,7 +674,7 @@ var _sdk = class _sdk {
|
|
|
657
674
|
}
|
|
658
675
|
};
|
|
659
676
|
/** Current version of the SDK */
|
|
660
|
-
_sdk.version = "1.1.
|
|
677
|
+
_sdk.version = "1.1.3";
|
|
661
678
|
/** Current maximum width of the playable ad container in pixels */
|
|
662
679
|
_sdk.maxWidth = Math.floor(window.innerWidth);
|
|
663
680
|
/** Current maximum height of the playable ad container in pixels */
|
package/dist/iife/index.js
CHANGED
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
|
|
131
131
|
// src/tracking.ts
|
|
132
132
|
function initTrackingProtocols() {
|
|
133
|
-
if (AD_NETWORK === "bigabid" || AD_NETWORK === "inmobi") {
|
|
133
|
+
if (AD_NETWORK === "bigabid" || AD_NETWORK === "inmobi" || AD_NETWORK === "remerge") {
|
|
134
134
|
let trackURL2 = function(url) {
|
|
135
135
|
if (url) {
|
|
136
136
|
const trackingPixel = new Image();
|
|
@@ -174,6 +174,22 @@
|
|
|
174
174
|
setTimeout(() => trackInMobiEvent2("Spent_25_Seconds"), 25e3);
|
|
175
175
|
setTimeout(() => trackInMobiEvent2("Spent_30_Seconds"), 3e4);
|
|
176
176
|
});
|
|
177
|
+
} else if (AD_NETWORK === "remerge") {
|
|
178
|
+
let trackRemergeEvent2 = function(event) {
|
|
179
|
+
if (window.REMERGE_BIDTIMEMACROS && window.REMERGE_BIDTIMEMACROS[event])
|
|
180
|
+
trackURL2(window.REMERGE_BIDTIMEMACROS[event]);
|
|
181
|
+
};
|
|
182
|
+
var trackRemergeEvent = trackRemergeEvent2;
|
|
183
|
+
sdk.once("boot", () => trackRemergeEvent2("ready"));
|
|
184
|
+
sdk.once("start", () => trackRemergeEvent2("impression"));
|
|
185
|
+
sdk.once("interaction", () => trackRemergeEvent2("engagement"));
|
|
186
|
+
sdk.once("install", () => trackRemergeEvent2("click"));
|
|
187
|
+
sdk.on("error", (message, action) => {
|
|
188
|
+
if (window.REMERGE_BIDTIMEMACROS && window.REMERGE_BIDTIMEMACROS.error)
|
|
189
|
+
trackURL2(
|
|
190
|
+
window.REMERGE_BIDTIMEMACROS.error.replace(/\{DOMAIN\}/g, encodeURIComponent(action || "")).replace(/\{ERR_MSG\}/g, encodeURIComponent(message || ""))
|
|
191
|
+
);
|
|
192
|
+
});
|
|
177
193
|
}
|
|
178
194
|
}
|
|
179
195
|
}
|
|
@@ -267,8 +283,9 @@
|
|
|
267
283
|
}
|
|
268
284
|
}
|
|
269
285
|
});
|
|
270
|
-
mraid.addEventListener("error", function(
|
|
271
|
-
console.log("mraid error: " +
|
|
286
|
+
mraid.addEventListener("error", function(message, action) {
|
|
287
|
+
console.log("mraid error: " + message + " action: " + action);
|
|
288
|
+
emitEvent("error", message, action);
|
|
272
289
|
});
|
|
273
290
|
if (AD_NETWORK === "unity") {
|
|
274
291
|
window.addEventListener("resize", function() {
|
|
@@ -659,7 +676,7 @@
|
|
|
659
676
|
}
|
|
660
677
|
};
|
|
661
678
|
/** Current version of the SDK */
|
|
662
|
-
_sdk.version = "1.1.
|
|
679
|
+
_sdk.version = "1.1.3";
|
|
663
680
|
/** Current maximum width of the playable ad container in pixels */
|
|
664
681
|
_sdk.maxWidth = Math.floor(window.innerWidth);
|
|
665
682
|
/** Current maximum height of the playable ad container in pixels */
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type EventName = 'init' | 'boot' | 'ready' | 'start' | 'interaction' | 'resize' | 'pause' | 'resume' | 'volume' | 'retry' | 'finish' | 'install';
|
|
1
|
+
type EventName = 'init' | 'boot' | 'ready' | 'start' | 'interaction' | 'resize' | 'pause' | 'resume' | 'volume' | 'retry' | 'finish' | 'install' | 'error';
|
|
2
2
|
|
|
3
3
|
type InitCallbackType = (maxWidth: number, maxHeight: number) => void;
|
|
4
4
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type EventName = 'init' | 'boot' | 'ready' | 'start' | 'interaction' | 'resize' | 'pause' | 'resume' | 'volume' | 'retry' | 'finish' | 'install';
|
|
1
|
+
type EventName = 'init' | 'boot' | 'ready' | 'start' | 'interaction' | 'resize' | 'pause' | 'resume' | 'volume' | 'retry' | 'finish' | 'install' | 'error';
|
|
2
2
|
|
|
3
3
|
type InitCallbackType = (maxWidth: number, maxHeight: number) => void;
|
|
4
4
|
/**
|
package/dist/index.js
CHANGED
|
@@ -155,7 +155,7 @@ function ensureProtocol() {
|
|
|
155
155
|
|
|
156
156
|
// src/tracking.ts
|
|
157
157
|
function initTrackingProtocols() {
|
|
158
|
-
if (AD_NETWORK === "bigabid" || AD_NETWORK === "inmobi") {
|
|
158
|
+
if (AD_NETWORK === "bigabid" || AD_NETWORK === "inmobi" || AD_NETWORK === "remerge") {
|
|
159
159
|
let trackURL2 = function(url) {
|
|
160
160
|
if (url) {
|
|
161
161
|
const trackingPixel = new Image();
|
|
@@ -199,6 +199,22 @@ function initTrackingProtocols() {
|
|
|
199
199
|
setTimeout(() => trackInMobiEvent2("Spent_25_Seconds"), 25e3);
|
|
200
200
|
setTimeout(() => trackInMobiEvent2("Spent_30_Seconds"), 3e4);
|
|
201
201
|
});
|
|
202
|
+
} else if (AD_NETWORK === "remerge") {
|
|
203
|
+
let trackRemergeEvent2 = function(event) {
|
|
204
|
+
if (window.REMERGE_BIDTIMEMACROS && window.REMERGE_BIDTIMEMACROS[event])
|
|
205
|
+
trackURL2(window.REMERGE_BIDTIMEMACROS[event]);
|
|
206
|
+
};
|
|
207
|
+
var trackRemergeEvent = trackRemergeEvent2;
|
|
208
|
+
sdk.once("boot", () => trackRemergeEvent2("ready"));
|
|
209
|
+
sdk.once("start", () => trackRemergeEvent2("impression"));
|
|
210
|
+
sdk.once("interaction", () => trackRemergeEvent2("engagement"));
|
|
211
|
+
sdk.once("install", () => trackRemergeEvent2("click"));
|
|
212
|
+
sdk.on("error", (message, action) => {
|
|
213
|
+
if (window.REMERGE_BIDTIMEMACROS && window.REMERGE_BIDTIMEMACROS.error)
|
|
214
|
+
trackURL2(
|
|
215
|
+
window.REMERGE_BIDTIMEMACROS.error.replace(/\{DOMAIN\}/g, encodeURIComponent(action || "")).replace(/\{ERR_MSG\}/g, encodeURIComponent(message || ""))
|
|
216
|
+
);
|
|
217
|
+
});
|
|
202
218
|
}
|
|
203
219
|
}
|
|
204
220
|
}
|
|
@@ -292,8 +308,9 @@ function startMraidProtocol() {
|
|
|
292
308
|
}
|
|
293
309
|
}
|
|
294
310
|
});
|
|
295
|
-
mraid.addEventListener("error", function(
|
|
296
|
-
console.log("mraid error: " +
|
|
311
|
+
mraid.addEventListener("error", function(message, action) {
|
|
312
|
+
console.log("mraid error: " + message + " action: " + action);
|
|
313
|
+
emitEvent("error", message, action);
|
|
297
314
|
});
|
|
298
315
|
if (AD_NETWORK === "unity") {
|
|
299
316
|
window.addEventListener("resize", function() {
|
|
@@ -684,7 +701,7 @@ var _sdk = class _sdk {
|
|
|
684
701
|
}
|
|
685
702
|
};
|
|
686
703
|
/** Current version of the SDK */
|
|
687
|
-
_sdk.version = "1.1.
|
|
704
|
+
_sdk.version = "1.1.3";
|
|
688
705
|
/** Current maximum width of the playable ad container in pixels */
|
|
689
706
|
_sdk.maxWidth = Math.floor(window.innerWidth);
|
|
690
707
|
/** Current maximum height of the playable ad container in pixels */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smoud/playable-sdk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "It's unified Playable SDK that supports MRAID, Google, Facebook, Vungle, and many more Ad Networks, simplifying playable ad development with a standardized interface for seamless cross-network compatibility.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|