@smoud/playable-sdk 1.0.8 → 1.0.9

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 CHANGED
@@ -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
- ## Custom Build Pipeline
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
- ### 1️⃣ Define Required Variables
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
- ### 2️ Applying Ad-Specific Adjustments
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
- ### 3️⃣ Minification & Optimization
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
- #### Recommended Tools:
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.
package/dist/esm/index.js CHANGED
@@ -120,7 +120,7 @@ function ensureProtocol() {
120
120
  }
121
121
 
122
122
  // src/core.ts
123
- var destinationUrl = /android/i.test(navigator.userAgent) ? GOOGLE_PLAY_URL : APP_STORE_URL;
123
+ var destinationUrl = "";
124
124
  var isSDKInitialized = false;
125
125
  var isProtocolInitialized = false;
126
126
  var isForcePaused = false;
@@ -333,6 +333,7 @@ var _sdk = class _sdk {
333
333
  */
334
334
  static init(callback) {
335
335
  if (isSDKInitialized) return;
336
+ destinationUrl = /android/i.test(navigator.userAgent) ? GOOGLE_PLAY_URL : APP_STORE_URL;
336
337
  ensureProtocol();
337
338
  if (callback) initCallback = callback;
338
339
  if ("mraid" === AD_PROTOCOL && isMraid()) {
@@ -122,7 +122,7 @@
122
122
  }
123
123
 
124
124
  // src/core.ts
125
- var destinationUrl = /android/i.test(navigator.userAgent) ? GOOGLE_PLAY_URL : APP_STORE_URL;
125
+ var destinationUrl = "";
126
126
  var isSDKInitialized = false;
127
127
  var isProtocolInitialized = false;
128
128
  var isForcePaused = false;
@@ -335,6 +335,7 @@
335
335
  */
336
336
  static init(callback) {
337
337
  if (isSDKInitialized) return;
338
+ destinationUrl = /android/i.test(navigator.userAgent) ? GOOGLE_PLAY_URL : APP_STORE_URL;
338
339
  ensureProtocol();
339
340
  if (callback) initCallback = callback;
340
341
  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 = /android/i.test(navigator.userAgent) ? GOOGLE_PLAY_URL : APP_STORE_URL;
150
+ var destinationUrl = "";
151
151
  var isSDKInitialized = false;
152
152
  var isProtocolInitialized = false;
153
153
  var isForcePaused = false;
@@ -360,6 +360,7 @@ var _sdk = class _sdk {
360
360
  */
361
361
  static init(callback) {
362
362
  if (isSDKInitialized) return;
363
+ destinationUrl = /android/i.test(navigator.userAgent) ? GOOGLE_PLAY_URL : APP_STORE_URL;
363
364
  ensureProtocol();
364
365
  if (callback) initCallback = callback;
365
366
  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.8",
3
+ "version": "1.0.9",
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",