sfc-utils 1.3.76 → 1.4.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.
@@ -14,7 +14,7 @@ function debounce(fn, ms) {
14
14
  }
15
15
  }
16
16
 
17
- function appendLayoutScripts(isEmbedded, isAdRemoved) {
17
+ function appendLayoutScripts(isEmbedded, isAdRemoved, marketKey) {
18
18
  const isApp = appCheck();
19
19
 
20
20
  // React Helmet is actually terrible and runs these scripts twice, so we are including them async ourselves
@@ -50,15 +50,16 @@ function appendLayoutScripts(isEmbedded, isAdRemoved) {
50
50
  document.body.appendChild(script)
51
51
 
52
52
  // Init sailthru
53
- // if (window && window.Sailthru){
54
- // window.Sailthru.init({ customerId: thisBrand.attributes.sailCustomer })
55
- // }
53
+ if (window && window.Sailthru && marketKey){
54
+ window.Sailthru.init({ customerId: getBrands2(marketKey).attributes.sailCustomer })
55
+ }
56
56
  }
57
57
  }, 5000)
58
58
  }
59
59
 
60
60
  function formatHDN(isEmbedded, url_add, meta) {
61
61
  const isApp = appCheck();
62
+ const thisBrand = getBrands2(meta.PROJECT.MARKET_KEY);
62
63
 
63
64
  // Combine our settings with what Hearst puts on page
64
65
  let stringHDN = ''
@@ -67,7 +68,7 @@ function formatHDN(isEmbedded, url_add, meta) {
67
68
  const metaHDN = Object.assign({}, meta)
68
69
  metaHDN.URL_ADD = url_add
69
70
  // Add sailthru var
70
- // metaHDN.SAIL_CUST = thisBrand.attributes.sailCustomer
71
+ metaHDN.SAIL_CUST = thisBrand.attributes.sailCustomer;
71
72
  // Make sure this is free on app
72
73
  if (isApp) {
73
74
  metaHDN.PAYWALL_SETTING = "free"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sfc-utils",
3
- "version": "1.3.76",
3
+ "version": "1.4.0",
4
4
  "author": "ewagstaff <evanjwagstaff@gmail.com>",
5
5
  "dependencies": {
6
6
  "archieml": "^0.4.2",