@blotoutio/edgetag-sdk-js 0.10.10 → 0.10.12

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/index.cjs CHANGED
@@ -204,6 +204,9 @@ const getReferrer = () => {
204
204
  };
205
205
  const getPageUrl = () => {
206
206
  try {
207
+ if (window.edgetagData && window.edgetagData['pageUrl']) {
208
+ return window.edgetagData['pageUrl'];
209
+ }
207
210
  return window.location.href;
208
211
  }
209
212
  catch (_a) {
@@ -516,7 +519,7 @@ const ajax = (method, url, payload) => __awaiter(void 0, void 0, void 0, functio
516
519
  });
517
520
  });
518
521
  const getStandardPayload = (payload) => {
519
- const data = Object.assign({ pageUrl: getPageUrl(), pageTitle: getPageTitle(), userAgent: getUserAgent(), referrer: getReferrer(), search: getSearch(), sdkVersion: "0.10.10" }, (payload || {}));
522
+ const data = Object.assign({ pageUrl: getPageUrl(), pageTitle: getPageTitle(), userAgent: getUserAgent(), referrer: getReferrer(), search: getSearch(), sdkVersion: "0.10.12" }, (payload || {}));
520
523
  let storage = {};
521
524
  const session = getData$1('session');
522
525
  if (session) {
package/index.d.ts CHANGED
@@ -108,3 +108,9 @@ export declare const getData: (
108
108
  export declare const keys: (callback: (keys: string[]) => void) => void
109
109
 
110
110
  export declare const getUserId: () => string
111
+
112
+ export declare global {
113
+ interface Window {
114
+ edgetagData: Record<string, string>
115
+ }
116
+ }
package/index.esm.js CHANGED
@@ -200,6 +200,9 @@ const getReferrer = () => {
200
200
  };
201
201
  const getPageUrl = () => {
202
202
  try {
203
+ if (window.edgetagData && window.edgetagData['pageUrl']) {
204
+ return window.edgetagData['pageUrl'];
205
+ }
203
206
  return window.location.href;
204
207
  }
205
208
  catch (_a) {
@@ -512,7 +515,7 @@ const ajax = (method, url, payload) => __awaiter(void 0, void 0, void 0, functio
512
515
  });
513
516
  });
514
517
  const getStandardPayload = (payload) => {
515
- const data = Object.assign({ pageUrl: getPageUrl(), pageTitle: getPageTitle(), userAgent: getUserAgent(), referrer: getReferrer(), search: getSearch(), sdkVersion: "0.10.10" }, (payload || {}));
518
+ const data = Object.assign({ pageUrl: getPageUrl(), pageTitle: getPageTitle(), userAgent: getUserAgent(), referrer: getReferrer(), search: getSearch(), sdkVersion: "0.10.12" }, (payload || {}));
516
519
  let storage = {};
517
520
  const session = getData$1('session');
518
521
  if (session) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotoutio/edgetag-sdk-js",
3
- "version": "0.10.10",
3
+ "version": "0.10.12",
4
4
  "description": "JS SDK for EdgeTag",
5
5
  "author": "Blotout",
6
6
  "license": "MIT",