@financial-times/cmp-client 3.1.3 → 3.1.4

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/dist/index.cjs CHANGED
@@ -7,7 +7,6 @@ var __publicField = (obj, key, value) => {
7
7
  };
8
8
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
9
9
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
10
- const version = "3.1.3";
11
10
  const events = {
12
11
  onMessageChoiceSelect: (...args) => {
13
12
  console.log("[debug] onMessageChoiceSelect", args);
@@ -3135,6 +3134,7 @@ const trackingEventHandlers = {
3135
3134
  });
3136
3135
  }
3137
3136
  };
3137
+ const version = "3.1.4";
3138
3138
  async function initSourcepointCmp({
3139
3139
  propertyConfig = FT_DOTCOM_PROD,
3140
3140
  userId,
@@ -3145,6 +3145,11 @@ async function initSourcepointCmp({
3145
3145
  useConsentStore = true,
3146
3146
  trackingContext = {}
3147
3147
  } = {}) {
3148
+ if (typeof window === "undefined") {
3149
+ console.error("The CMP client can only be initialised in a browser context");
3150
+ return;
3151
+ }
3152
+ window.FT_CMP_CLIENT_VERSION = version;
3148
3153
  if (!userId && useFTSession) {
3149
3154
  try {
3150
3155
  const response = await getUuid();
@@ -3182,7 +3187,6 @@ async function initSourcepointCmp({
3182
3187
  });
3183
3188
  initTracking(trackingContext);
3184
3189
  }
3185
- window.FT_CMP_CLIENT_VERSION = version;
3186
3190
  exports.debug = debug;
3187
3191
  exports.initSourcepointCmp = initSourcepointCmp;
3188
3192
  exports.properties = properties;
package/dist/index.js CHANGED
@@ -5,7 +5,6 @@ var __publicField = (obj, key, value) => {
5
5
  return value;
6
6
  };
7
7
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
8
- const version = "3.1.3";
9
8
  const events = {
10
9
  onMessageChoiceSelect: (...args) => {
11
10
  console.log("[debug] onMessageChoiceSelect", args);
@@ -3133,6 +3132,7 @@ const trackingEventHandlers = {
3133
3132
  });
3134
3133
  }
3135
3134
  };
3135
+ const version = "3.1.4";
3136
3136
  async function initSourcepointCmp({
3137
3137
  propertyConfig = FT_DOTCOM_PROD,
3138
3138
  userId,
@@ -3143,6 +3143,11 @@ async function initSourcepointCmp({
3143
3143
  useConsentStore = true,
3144
3144
  trackingContext = {}
3145
3145
  } = {}) {
3146
+ if (typeof window === "undefined") {
3147
+ console.error("The CMP client can only be initialised in a browser context");
3148
+ return;
3149
+ }
3150
+ window.FT_CMP_CLIENT_VERSION = version;
3146
3151
  if (!userId && useFTSession) {
3147
3152
  try {
3148
3153
  const response = await getUuid();
@@ -3180,7 +3185,6 @@ async function initSourcepointCmp({
3180
3185
  });
3181
3186
  initTracking(trackingContext);
3182
3187
  }
3183
- window.FT_CMP_CLIENT_VERSION = version;
3184
3188
  export {
3185
3189
  debug,
3186
3190
  initSourcepointCmp,
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAU5D,wBAAsB,kBAAkB,CAAC,EACvC,cAA+B,EAC/B,MAAM,EACN,YAAmB,EACnB,gBAAwC,EACxC,YAA+B,EAC/B,aAAkC,EAClC,eAAsB,EACtB,eAAoB,GACrB,GAAE,cAAmB,iBAyCrB"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAW5D,wBAAsB,kBAAkB,CAAC,EACvC,cAA+B,EAC/B,MAAM,EACN,YAAmB,EACnB,gBAAwC,EACxC,YAA+B,EAC/B,aAAkC,EAClC,eAAsB,EACtB,eAAoB,GACrB,GAAE,cAAmB,iBAgDrB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@financial-times/cmp-client",
3
- "version": "3.1.3",
3
+ "version": "3.1.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": [