@sellwild/react-native-sdk 1.0.1 → 1.2.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sellwild/react-native-sdk",
3
- "version": "1.0.1",
3
+ "version": "1.2.0",
4
4
  "description": "Sellwild mobile advertising SDK for React Native",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -23,7 +23,7 @@
23
23
  "react-native-webview": ">=11.0.0"
24
24
  },
25
25
  "dependencies": {
26
- "@sellwild/sdk-core": "^1.0.0"
26
+ "@sellwild/sdk-core": "^1.2.0"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/react": "^18.0.0",
@@ -1,4 +1,5 @@
1
1
  import type { SellwildConfig, AdSize } from '@sellwild/sdk-core'
2
+ import { resolveListingsUrl } from '@sellwild/sdk-core'
2
3
 
3
4
  const WIDGET_CDN = 'https://widget.sellwild.com'
4
5
 
@@ -109,7 +110,7 @@ function configToAttributes(config: SellwildConfig): string {
109
110
 
110
111
  // Identity / listings
111
112
  add('partner-code', config.partnerCode)
112
- add('listings', config.listingsUrl)
113
+ add('listings', resolveListingsUrl(config))
113
114
 
114
115
  // Disable remote customization fetch — the widget defaults to fetching
115
116
  // https://widget.sellwild.com/{partnerCode}/{slug}.json which (a) doesn't
@@ -184,31 +185,59 @@ function configToAttributes(config: SellwildConfig): string {
184
185
  add('s2s-config', config.s2sConfig)
185
186
  add('iab-cats', config.iabCats?.join(','))
186
187
 
187
- // Bidders (serialized as JSON — parseValue() in the widget will JSON.parse these)
188
- add('ix', config.ix)
189
- add('openx', config.openx)
190
- add('pubmatic', config.pubmatic)
191
- add('appnexus', config.appnexus)
192
- add('rubicon', config.rubicon)
193
- add('apstag', config.apstag)
194
-
195
- // Waterfall
196
- add('pub-ventures', config.pubVentures)
197
- add('saambaa', config.saambaa)
198
- add('opsco', config.opsco)
199
- add('bidstream', config.bidstream)
200
-
201
- // Third-party
188
+ // Third-party (typed fields with defaults — kept emitted explicitly for
189
+ // backwards compatibility with static buildConfig() callers)
202
190
  add('boltive', config.boltive || undefined)
203
191
  add('boltive-client-id', config.boltiveClientId)
204
192
  add('lotame', config.lotame || undefined)
205
193
  add('growthcode', config.growthcode)
206
194
  add('bh-tag', config.bhTag)
207
195
 
196
+ // Mobile ad controls
197
+ add('enable-interstitial', config.enableInterstitial || undefined)
198
+ add('enable-fullscreen-video', config.enableFullscreenVideo || undefined)
199
+ add('interstitials-per-session', config.interstitialsPerSession)
200
+ add('video-takeovers-per-session', config.videoTakeoversPerSession)
201
+
208
202
  // Debug
209
203
  add('debug', config.debug || undefined)
210
204
  add('membership-type', config.membershipType)
211
205
 
206
+ // ─── Remote passthrough ────────────────────────────────────────────────────
207
+ // Forward the raw CDN payload verbatim. The widget's attribute parser is
208
+ // case-insensitive (kebab-case / camelCase / CONSTANT_CASE all work) and
209
+ // accepts unknown keys, so every CMS-defined bidder, waterfall partner, or
210
+ // ad-network setting flows through to the WebView without an SDK release.
211
+ //
212
+ // Skip keys that we already emitted via typed fields above to avoid
213
+ // double-emission. Identity fields (CODE, SLUG, NAME, LISTINGS) are handled
214
+ // by the typed block; everything else (bidders, third-party, etc.) lands
215
+ // here as the canonical CONSTANT_CASE attribute.
216
+ const emittedFromTyped = new Set<string>([
217
+ 'CODE', 'SLUG', 'NAME', 'LISTINGS',
218
+ 'TITLE', 'LINK_TEXT', 'BUY_NOW_TEXT', 'TITLE_COLOR', 'LINK_COLOR',
219
+ 'FONT_FAMILY', 'FONT_URL', 'FONT_COLOR', 'PRICE_COLOR', 'PRICE_FONT_COLOR',
220
+ 'MARGIN_BOTTOM', 'CARD_WIDTH', 'OVERLAY_TITLE', 'COLORS', 'CSS',
221
+ 'WATERMARK', 'WATERMARK_TITLE',
222
+ 'BANNER_ZID', 'BOTTOM_BANNER_ZID', 'MOBILE_BANNER_ZID', 'MOBILE_ZID',
223
+ 'DISPLAY_ZID', 'HIDE_BANNER_TOP', 'HIDE_BANNER_BOTTOM', 'GAM',
224
+ 'DISABLE_GPT', 'AD_UNITS', 'SAFE_FRAME', 'AD_DISABLE_DISPLAY',
225
+ 'AD_REFRESH_MAX', 'AD_REFRESH_MAX_MOBILE', 'AD_REFRESH_INTERVAL',
226
+ 'MAX_FAILED_AUCTIONS', 'PREBID_DEFER', 'PREBID_SRC',
227
+ 'AD_GEO_BLOCK', 'AD_GEO_BLOCK_REFRESH',
228
+ 'GPP_ENABLED', 'TCF_VERSION', 'CONSENT_MANAGEMENT', 'SCHAIN_SID',
229
+ 'S2S_CONFIG', 'IAB_CATS',
230
+ 'ENABLE_INTERSTITIAL', 'ENABLE_FULLSCREEN_VIDEO',
231
+ 'INTERSTITIALS_PER_SESSION', 'VIDEO_TAKEOVERS_PER_SESSION',
232
+ 'BOLTIVE', 'BOLTIVE_CLIENT_ID', 'LOTAME', 'GROWTHCODE', 'BH_TAG',
233
+ ])
234
+ if (config.remote) {
235
+ for (const [key, value] of Object.entries(config.remote)) {
236
+ if (emittedFromTyped.has(key)) continue
237
+ add(key, value)
238
+ }
239
+ }
240
+
212
241
  return parts.join('\n ')
213
242
  }
214
243
 
package/src/index.ts CHANGED
@@ -21,4 +21,13 @@ export type {
21
21
  AdPlacementType,
22
22
  } from '@sellwild/sdk-core'
23
23
 
24
- export { buildConfig, currencyToSymbol } from '@sellwild/sdk-core'
24
+ export {
25
+ configure,
26
+ buildConfig,
27
+ buildConfigWithRemote,
28
+ currencyToSymbol,
29
+ fetchRemoteConfig,
30
+ clearRemoteConfigCache,
31
+ } from '@sellwild/sdk-core'
32
+
33
+ export type { ConfigureOptions } from '@sellwild/sdk-core'