@smoud/playable-sdk 1.0.8 → 1.0.10
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/LICENSE +21 -0
- package/README.md +19 -21
- package/dist/esm/index.js +2 -2
- package/dist/iife/index.js +2 -2
- package/dist/index.js +2 -2
- package/package.json +2 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-present Smoud
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[](https://deepscan.io/dashboard#view=project&tid=19616&pid=29066&bid=935410)
|
|
7
7
|
[](https://opensource.org/license/MIT)
|
|
8
8
|
|
|
9
|
-
It's powerful, unified SDK that seamlessly integrates multiple ad network SDKs, including MRAID, Google, Facebook, Vungle, and many more. Designed for effortless playable ad development, it provides a standardized interface, ensuring compatibility, optimization, and easy deployment across various platforms. With
|
|
9
|
+
It's powerful, unified SDK that seamlessly integrates multiple ad network SDKs, including MRAID, Google, Facebook, Vungle, and many more. Designed for effortless playable ad development, it provides a standardized interface, ensuring compatibility, optimization, and easy deployment across various platforms. With `@smoud/playable-sdk`, you can streamline your workflow, maximize reach, and focus on crafting engaging interactive ads without worrying about SDK fragmentation. 🚀
|
|
10
10
|
|
|
11
11
|
## Features
|
|
12
12
|
|
|
@@ -143,20 +143,6 @@ To generate a playable ad ready for an ad network, use the build command:
|
|
|
143
143
|
npm run build <ad-network>
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
-
##### Examples:
|
|
147
|
-
|
|
148
|
-
To build for **Applovin**, run:
|
|
149
|
-
|
|
150
|
-
```sh
|
|
151
|
-
npm run build applovin
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
To build for **IronSource DAPI**, run:
|
|
155
|
-
|
|
156
|
-
```sh
|
|
157
|
-
npm run build ironsource -- --protocol dapi
|
|
158
|
-
```
|
|
159
|
-
|
|
160
146
|
Supported **Ad Networks**:
|
|
161
147
|
|
|
162
148
|
- `applovin`
|
|
@@ -177,13 +163,15 @@ Supported **Ad Networks**:
|
|
|
177
163
|
- `mytarget`
|
|
178
164
|
- `liftoff`
|
|
179
165
|
|
|
180
|
-
|
|
166
|
+
See more details in [`GitHub repository.`](https://github.com/smoudjs/playable-scripts?tab=readme-ov-file#installation)
|
|
167
|
+
|
|
168
|
+
### Custom Build Pipeline
|
|
181
169
|
|
|
182
|
-
Before setting up a custom pipeline, consider using `@smoud/playable-scripts`. It provides an API to extend the standard build function and simplifies the process. See details [here](https://github.com/smoudjs/playable-scripts).
|
|
170
|
+
Before setting up a custom pipeline, consider using `@smoud/playable-scripts`. It provides an API to extend the standard build function and simplifies the process. See more details [here](https://github.com/smoudjs/playable-scripts).
|
|
183
171
|
|
|
184
172
|
If you still prefer a fully custom build, you need to manage the following aspects yourself:
|
|
185
173
|
|
|
186
|
-
|
|
174
|
+
#### 1️⃣ Define Required Variables
|
|
187
175
|
|
|
188
176
|
Your build script should replace or define these variables within the `window` object before the rest of your code executes:
|
|
189
177
|
|
|
@@ -195,17 +183,17 @@ APP_STORE_URL = 'https://apps.apple.com/app/id123456789';
|
|
|
195
183
|
BUILD_HASH = 'random-build-hash';
|
|
196
184
|
```
|
|
197
185
|
|
|
198
|
-
|
|
186
|
+
#### 2️⃣ Applying Ad-Specific Adjustments
|
|
199
187
|
|
|
200
188
|
Certain networks use different ad protocols. Ensure that your build includes or removes code based on the network.
|
|
201
189
|
|
|
202
190
|
Check [Ad Network Resources & Requirements](#Ad-Network-Resources-&-Requirements) for more details.
|
|
203
191
|
|
|
204
|
-
|
|
192
|
+
#### 3️⃣ Minification & Optimization
|
|
205
193
|
|
|
206
194
|
To ensure the best performance, your build should include a **JavaScript minimizer** to remove unnecessary code.
|
|
207
195
|
|
|
208
|
-
|
|
196
|
+
##### Recommended Tools:
|
|
209
197
|
|
|
210
198
|
- [Terser](https://github.com/terser/terser) – Best for JS minification.
|
|
211
199
|
- [UglifyJS](https://github.com/mishoo/UglifyJS) – Alternative for JS compression.
|
|
@@ -372,6 +360,16 @@ sdk.off('eventName', [callback], [context]);
|
|
|
372
360
|
| `sdk.volume` | number | Default volume level (0-1), when muting/unmuting audio |
|
|
373
361
|
| `sdk.interactions` | number | User interaction count |
|
|
374
362
|
|
|
363
|
+
## Demo Projects
|
|
364
|
+
|
|
365
|
+
Get started quickly with our template projects:
|
|
366
|
+
|
|
367
|
+
- [playable-template-base](https://github.com/smoudjs/playable-template-base) - Clean TypeScript starter with minimal dependencies
|
|
368
|
+
- [playable-template-base-js](https://github.com/smoudjs/playable-template-base-js) - Clean JavaScript starter with minimal dependencies
|
|
369
|
+
- [playable-template-pixi](https://github.com/smoudjs/playable-template-pixi) - PixiJS template for 2D playable ads
|
|
370
|
+
- [playable-template-three](https://github.com/smoudjs/playable-template-three) - Three.js template for 3D playable ads
|
|
371
|
+
- [playable-template-phaser](https://github.com/smoudjs/playable-template-phaser) - Phaser template for 2D playable ads
|
|
372
|
+
|
|
375
373
|
## References
|
|
376
374
|
|
|
377
375
|
### Ad Network Resources & Requirements
|
package/dist/esm/index.js
CHANGED
|
@@ -120,7 +120,7 @@ function ensureProtocol() {
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
// src/core.ts
|
|
123
|
-
var destinationUrl =
|
|
123
|
+
var destinationUrl = "";
|
|
124
124
|
var isSDKInitialized = false;
|
|
125
125
|
var isProtocolInitialized = false;
|
|
126
126
|
var isForcePaused = false;
|
|
@@ -241,7 +241,6 @@ function startDapiProtocol() {
|
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
function startDefaultProtocol() {
|
|
244
|
-
if ("none" !== AD_PROTOCOL) return;
|
|
245
244
|
if (!isProtocolInitialized) {
|
|
246
245
|
if ("mintegral" === AD_NETWORK) {
|
|
247
246
|
window.mintGameStart = function() {
|
|
@@ -333,6 +332,7 @@ var _sdk = class _sdk {
|
|
|
333
332
|
*/
|
|
334
333
|
static init(callback) {
|
|
335
334
|
if (isSDKInitialized) return;
|
|
335
|
+
destinationUrl = /android/i.test(navigator.userAgent) ? GOOGLE_PLAY_URL : APP_STORE_URL;
|
|
336
336
|
ensureProtocol();
|
|
337
337
|
if (callback) initCallback = callback;
|
|
338
338
|
if ("mraid" === AD_PROTOCOL && isMraid()) {
|
package/dist/iife/index.js
CHANGED
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
// src/core.ts
|
|
125
|
-
var destinationUrl =
|
|
125
|
+
var destinationUrl = "";
|
|
126
126
|
var isSDKInitialized = false;
|
|
127
127
|
var isProtocolInitialized = false;
|
|
128
128
|
var isForcePaused = false;
|
|
@@ -243,7 +243,6 @@
|
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
function startDefaultProtocol() {
|
|
246
|
-
if ("none" !== AD_PROTOCOL) return;
|
|
247
246
|
if (!isProtocolInitialized) {
|
|
248
247
|
if ("mintegral" === AD_NETWORK) {
|
|
249
248
|
window.mintGameStart = function() {
|
|
@@ -335,6 +334,7 @@
|
|
|
335
334
|
*/
|
|
336
335
|
static init(callback) {
|
|
337
336
|
if (isSDKInitialized) return;
|
|
337
|
+
destinationUrl = /android/i.test(navigator.userAgent) ? GOOGLE_PLAY_URL : APP_STORE_URL;
|
|
338
338
|
ensureProtocol();
|
|
339
339
|
if (callback) initCallback = callback;
|
|
340
340
|
if ("mraid" === AD_PROTOCOL && isMraid()) {
|
package/dist/index.js
CHANGED
|
@@ -147,7 +147,7 @@ function ensureProtocol() {
|
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
// src/core.ts
|
|
150
|
-
var destinationUrl =
|
|
150
|
+
var destinationUrl = "";
|
|
151
151
|
var isSDKInitialized = false;
|
|
152
152
|
var isProtocolInitialized = false;
|
|
153
153
|
var isForcePaused = false;
|
|
@@ -268,7 +268,6 @@ function startDapiProtocol() {
|
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
function startDefaultProtocol() {
|
|
271
|
-
if ("none" !== AD_PROTOCOL) return;
|
|
272
271
|
if (!isProtocolInitialized) {
|
|
273
272
|
if ("mintegral" === AD_NETWORK) {
|
|
274
273
|
window.mintGameStart = function() {
|
|
@@ -360,6 +359,7 @@ var _sdk = class _sdk {
|
|
|
360
359
|
*/
|
|
361
360
|
static init(callback) {
|
|
362
361
|
if (isSDKInitialized) return;
|
|
362
|
+
destinationUrl = /android/i.test(navigator.userAgent) ? GOOGLE_PLAY_URL : APP_STORE_URL;
|
|
363
363
|
ensureProtocol();
|
|
364
364
|
if (callback) initCallback = callback;
|
|
365
365
|
if ("mraid" === AD_PROTOCOL && isMraid()) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smoud/playable-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
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",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
13
|
"dist",
|
|
14
|
+
"LICENSE",
|
|
14
15
|
"README.md",
|
|
15
16
|
"defines.d.ts"
|
|
16
17
|
],
|