@screeb/sdk-browser 0.1.13 → 0.1.15

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.
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var SCREEB_TAG_ENDPOINT = "https://t.screeb.app/tag.js";
4
+ var CONSTANTS = { version: "0.0.0-dev" };
4
5
  var _window = typeof window === "undefined" ? undefined : window;
5
6
  var callScreebCommand = function () {
6
7
  var args = [];
@@ -29,7 +30,7 @@ var callScreebCommand = function () {
29
30
  var load = function (options) {
30
31
  if (options === void 0) { options = {}; }
31
32
  return new Promise(function (resolve, reject) {
32
- var _a, _b, _c;
33
+ var _a, _b, _c, _d, _e;
33
34
  _window = (_a = options.window) !== null && _a !== void 0 ? _a : window;
34
35
  var scriptElement = document.createElement("script");
35
36
  scriptElement.async = true;
@@ -56,6 +57,11 @@ var load = function (options) {
56
57
  });
57
58
  };
58
59
  _window.document.head.appendChild(scriptElement);
60
+ var context = {
61
+ secondary_sdk_name: (_d = options.sdkName) !== null && _d !== void 0 ? _d : "sdk-browser",
62
+ secondary_sdk_version: (_e = options.sdkVersion) !== null && _e !== void 0 ? _e : CONSTANTS.version,
63
+ };
64
+ callScreebCommand("client.internal.web", context);
59
65
  });
60
66
  };
61
67
  /**
@@ -438,3 +444,4 @@ exports.surveyClose = surveyClose;
438
444
  exports.surveyStart = surveyStart;
439
445
  exports.targetingCheck = targetingCheck;
440
446
  exports.targetingDebug = targetingDebug;
447
+ CONSTANTS.version = '0.1.15'
@@ -9,6 +9,10 @@ export type PropertyRecord = {
9
9
  export type ScreebOptions = {
10
10
  /** If you're running Screeb tag in an iframe, please set the inner window here. */
11
11
  window?: Window;
12
+ /** SDK name (eg: sdk-browser, sdk-react, sdk-angular, etc...) */
13
+ sdkName?: string;
14
+ /** SDK version (eg: 1.2.3) */
15
+ sdkVersion?: string;
12
16
  /** Please don't do this. */
13
17
  screebEndpoint?: string;
14
18
  };
@@ -1,4 +1,5 @@
1
1
  var SCREEB_TAG_ENDPOINT = "https://t.screeb.app/tag.js";
2
+ var CONSTANTS = { version: "0.0.0-dev" };
2
3
  var _window = typeof window === "undefined" ? undefined : window;
3
4
  var callScreebCommand = function () {
4
5
  var args = [];
@@ -27,7 +28,7 @@ var callScreebCommand = function () {
27
28
  var load = function (options) {
28
29
  if (options === void 0) { options = {}; }
29
30
  return new Promise(function (resolve, reject) {
30
- var _a, _b, _c;
31
+ var _a, _b, _c, _d, _e;
31
32
  _window = (_a = options.window) !== null && _a !== void 0 ? _a : window;
32
33
  var scriptElement = document.createElement("script");
33
34
  scriptElement.async = true;
@@ -54,6 +55,11 @@ var load = function (options) {
54
55
  });
55
56
  };
56
57
  _window.document.head.appendChild(scriptElement);
58
+ var context = {
59
+ secondary_sdk_name: (_d = options.sdkName) !== null && _d !== void 0 ? _d : "sdk-browser",
60
+ secondary_sdk_version: (_e = options.sdkVersion) !== null && _e !== void 0 ? _e : CONSTANTS.version,
61
+ };
62
+ callScreebCommand("client.internal.web", context);
57
63
  });
58
64
  };
59
65
  /**
@@ -421,3 +427,4 @@ var targetingCheck = function () { return callScreebCommand("targeting.check");
421
427
  var targetingDebug = function () { return callScreebCommand("targeting.debug"); };
422
428
 
423
429
  export { close, debug, eventTrack, identity, identityGet, identityGroupAssign, identityGroupUnassign, identityProperties, identityReset, init, isLoaded, load, surveyClose, surveyStart, targetingCheck, targetingDebug };
430
+ CONSTANTS.version = '0.1.15'
@@ -9,6 +9,10 @@ export type PropertyRecord = {
9
9
  export type ScreebOptions = {
10
10
  /** If you're running Screeb tag in an iframe, please set the inner window here. */
11
11
  window?: Window;
12
+ /** SDK name (eg: sdk-browser, sdk-react, sdk-angular, etc...) */
13
+ sdkName?: string;
14
+ /** SDK version (eg: 1.2.3) */
15
+ sdkVersion?: string;
12
16
  /** Please don't do this. */
13
17
  screebEndpoint?: string;
14
18
  };
package/docs/README.md CHANGED
@@ -354,6 +354,8 @@ This is the Screeb tag options object.
354
354
  | Name | Type | Description |
355
355
  | :------ | :------ | :------ |
356
356
  | `screebEndpoint?` | `string` | Please don't do this. |
357
+ | `sdkName?` | `string` | SDK name (eg: sdk-browser, sdk-react, sdk-angular, etc...) |
358
+ | `sdkVersion?` | `string` | SDK version (eg: 1.2.3) |
357
359
  | `window?` | `Window` | If you're running Screeb tag in an iframe, please set the inner window here. |
358
360
 
359
361
  ___
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@screeb/sdk-browser",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "Screeb's browser sdk.",
5
5
  "keywords": [
6
6
  "product discovery",
@@ -25,8 +25,8 @@
25
25
  "author": "Screeb's frontend team",
26
26
  "sideEffects": false,
27
27
  "type": "module",
28
- "module": "dist/es/index.js",
29
- "main": "dist/cjs/index.js",
28
+ "module": "dist/es/index.mjs",
29
+ "main": "dist/cjs/index.cjs",
30
30
  "types": "dist/es/index.d.ts",
31
31
  "files": [
32
32
  "dist",
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "devDependencies": {
44
44
  "@screeb/eslint-config": "^0.1.6",
45
- "@screeb/typescript-config": "^0.1.8",
45
+ "@screeb/typescript-config": "^0.1.10",
46
46
  "@types/jest": "^29.5.5",
47
47
  "@types/node": "^20.8.4",
48
48
  "@typescript-eslint/eslint-plugin": "^6.7.5",