react-native-clarity 0.0.1-beta.1 → 0.0.1-beta.3

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/README.md CHANGED
@@ -16,7 +16,7 @@ import { setCustomUserId } from 'react-native-clarity';
16
16
  import { getCurrentSessionId } from 'react-native-clarity';
17
17
 
18
18
  // Initialize Clarity.
19
- initialize("<ProjectId>", "<UserId>", "Verbose", true, true, ["*"]);
19
+ initialize("<ProjectId>");
20
20
 
21
21
  // Set custom user id.
22
22
  setCustomUserId("react@native.com");
@@ -26,12 +26,13 @@ getCurrentSessionId().then((id) => {...});
26
26
  ```
27
27
 
28
28
  ### Initialization arguments
29
+
29
30
  ```js
30
31
  /**
31
32
  * Initializes the Clarity plugin with the provided parameters.
32
33
  *
33
34
  * @param projectId The Clarity project id to send data to.
34
- * @param userId A custom identifier for the current user. If passed as null, the user id
35
+ * @param userId A custom identifier for the current user. If passed as undefined, the user id
35
36
  * will be auto generated. The user id in general is sticky across sessions.
36
37
  * The provided user id must follow these conditions:
37
38
  * 1. Cannot be an empty string.
@@ -44,11 +45,11 @@ getCurrentSessionId().then((id) => {...});
44
45
  */
45
46
  function initialize(
46
47
  projectId: string,
47
- userId: string,
48
- logLevel: string,
49
- allowMeteredNetworkUsage: boolean,
50
- enableWebViewCapture: boolean,
51
- allowedDomains: string[])
48
+ userId?: string,
49
+ logLevel: string = "None",
50
+ allowMeteredNetworkUsage: boolean = false,
51
+ enableWebViewCapture: boolean = true,
52
+ allowedDomains: string[] = ["*"])
52
53
  ```
53
54
 
54
55
  ## License
@@ -16,7 +16,7 @@ class ClarityModule(reactContext: ReactApplicationContext) :
16
16
  @ReactMethod
17
17
  fun initialize(
18
18
  projectId: String,
19
- userId: String,
19
+ userId: String?,
20
20
  logLevel: String,
21
21
  allowMeteredNetworkUsage: Boolean,
22
22
  enableWebViewCapture: Boolean,
@@ -17,7 +17,7 @@ const Clarity = _reactNative.NativeModules.Clarity;
17
17
  * Initializes the Clarity plugin with the provided parameters.
18
18
  *
19
19
  * @param projectId The Clarity project id to send data to.
20
- * @param userId A custom identifier for the current user. If passed as null, the user id
20
+ * @param userId A custom identifier for the current user. If passed as undefined, the user id
21
21
  * will be auto generated. The user id in general is sticky across sessions.
22
22
  * The provided user id must follow these conditions:
23
23
  * 1. Cannot be an empty string.
@@ -28,7 +28,11 @@ const Clarity = _reactNative.NativeModules.Clarity;
28
28
  * @param allowedDomains The whitelisted domains to allow Clarity to capture their DOM content.
29
29
  * If it contains "*" as an element, all domains will be captured.
30
30
  */
31
- function initialize(projectId, userId, logLevel, allowMeteredNetworkUsage, enableWebViewCapture, allowedDomains) {
31
+ function initialize(projectId, userId) {
32
+ let logLevel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "None";
33
+ let allowMeteredNetworkUsage = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
34
+ let enableWebViewCapture = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
35
+ let allowedDomains = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : ["*"];
32
36
  if (Clarity === null) {
33
37
  console.error("Clarity did not initialize properly.", LINKING_ERROR);
34
38
  return;
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","Clarity","NativeModules","initialize","projectId","userId","logLevel","allowMeteredNetworkUsage","enableWebViewCapture","allowedDomains","console","error","OS","warn","setCustomUserId","customUserId","getCurrentSessionId","Promise","resolve"],"sourceRoot":"..\\..\\src","sources":["index.tsx"],"mappings":";;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAMC,aAAa,GAChB,+EAA8E,GAC/EC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,OAAO,GAAGC,0BAAa,CAACD,OAAO;;AAErC;AACA;AAC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AAO,IAAII,OAAO,CAAEC,OAAO,IAAK;MAC9BA,OAAO,CAAC,WAAW,CAAC;IACtB,CAAC,CAAC;EACJ;EAEA,OAAOjB,OAAO,CAACe,mBAAmB,EAAE;AACtC"}
1
+ {"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","Clarity","NativeModules","initialize","projectId","userId","logLevel","arguments","length","undefined","allowMeteredNetworkUsage","enableWebViewCapture","allowedDomains","console","error","OS","warn","setCustomUserId","customUserId","getCurrentSessionId","Promise","resolve"],"sourceRoot":"..\\..\\src","sources":["index.tsx"],"mappings":";;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAMC,aAAa,GAChB,+EAA8E,GAC/EC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,OAAO,GAAGC,0BAAa,CAACD,OAAO;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,UAAUA,CACxBC,SAAiB,EACjBC,MAAe,EAImB;EAAA,IAHlCC,QAAgB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,MAAM;EAAA,IACzBG,wBAAiC,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;EAAA,IACzCI,oBAA6B,GAAAJ,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;EAAA,IACpCK,cAAwB,GAAAL,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,GAAG,CAAC;EAChC,IAAIN,OAAO,KAAK,IAAI,EAAE;IACpBY,OAAO,CAACC,KAAK,CAAC,sCAAsC,EAAElB,aAAa,CAAC;IACpE;EACF;EAEA,IAAIC,qBAAQ,CAACkB,EAAE,KAAK,SAAS,EAAE;IAC7BF,OAAO,CAACG,IAAI,CAAC,wCAAwC,CAAC;IACtD;EACF;EAEAf,OAAO,CAACE,UAAU,CAACC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,EAAEI,wBAAwB,EAAEC,oBAAoB,EAAEC,cAAc,CAAC;AACjH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASK,eAAeA,CAACC,YAAoB,EAAE;EACpD,IAAIjB,OAAO,KAAK,IAAI,EAAE;IACpBY,OAAO,CAACC,KAAK,CAAC,sCAAsC,EAAElB,aAAa,CAAC;IACpE;EACF;EAEA,IAAIC,qBAAQ,CAACkB,EAAE,KAAK,SAAS,EAAE;IAC7BF,OAAO,CAACG,IAAI,CAAC,wCAAwC,CAAC;IACtD;EACF;EAEAf,OAAO,CAACgB,eAAe,CAACC,YAAY,CAAC;AACvC;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASC,mBAAmBA,CAAA,EAAoB;EACrD,IAAIlB,OAAO,KAAK,IAAI,EAAE;IACpBY,OAAO,CAACC,KAAK,CAAC,sCAAsC,EAAElB,aAAa,CAAC;IACpE,OAAO,IAAIwB,OAAO,CAAEC,OAAO,IAAK;MAC9BA,OAAO,CAAC,WAAW,CAAC;IACtB,CAAC,CAAC;EACJ;EAEA,IAAIxB,qBAAQ,CAACkB,EAAE,KAAK,SAAS,EAAE;IAC7BF,OAAO,CAACG,IAAI,CAAC,wCAAwC,CAAC;IACtD,OAAO,IAAII,OAAO,CAAEC,OAAO,IAAK;MAC9BA,OAAO,CAAC,WAAW,CAAC;IACtB,CAAC,CAAC;EACJ;EAEA,OAAOpB,OAAO,CAACkB,mBAAmB,EAAE;AACtC"}
@@ -9,7 +9,7 @@ const Clarity = NativeModules.Clarity;
9
9
  * Initializes the Clarity plugin with the provided parameters.
10
10
  *
11
11
  * @param projectId The Clarity project id to send data to.
12
- * @param userId A custom identifier for the current user. If passed as null, the user id
12
+ * @param userId A custom identifier for the current user. If passed as undefined, the user id
13
13
  * will be auto generated. The user id in general is sticky across sessions.
14
14
  * The provided user id must follow these conditions:
15
15
  * 1. Cannot be an empty string.
@@ -20,7 +20,11 @@ const Clarity = NativeModules.Clarity;
20
20
  * @param allowedDomains The whitelisted domains to allow Clarity to capture their DOM content.
21
21
  * If it contains "*" as an element, all domains will be captured.
22
22
  */
23
- export function initialize(projectId, userId, logLevel, allowMeteredNetworkUsage, enableWebViewCapture, allowedDomains) {
23
+ export function initialize(projectId, userId) {
24
+ let logLevel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "None";
25
+ let allowMeteredNetworkUsage = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
26
+ let enableWebViewCapture = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
27
+ let allowedDomains = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : ["*"];
24
28
  if (Clarity === null) {
25
29
  console.error("Clarity did not initialize properly.", LINKING_ERROR);
26
30
  return;
@@ -1 +1 @@
1
- {"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","Clarity","initialize","projectId","userId","logLevel","allowMeteredNetworkUsage","enableWebViewCapture","allowedDomains","console","error","OS","warn","setCustomUserId","customUserId","getCurrentSessionId","Promise","resolve"],"sourceRoot":"..\\..\\src","sources":["index.tsx"],"mappings":"AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAEtD,MAAMC,aAAa,GAChB,+EAA8E,GAC/ED,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,OAAO,GAAGN,aAAa,CAACM,OAAO;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OA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,WAAW,CAAC;IACtB,CAAC,CAAC;EACJ;EAEA,OAAOhB,OAAO,CAACc,mBAAmB,EAAE;AACtC"}
1
+ {"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","Clarity","initialize","projectId","userId","logLevel","arguments","length","undefined","allowMeteredNetworkUsage","enableWebViewCapture","allowedDomains","console","error","OS","warn","setCustomUserId","customUserId","getCurrentSessionId","Promise","resolve"],"sourceRoot":"..\\..\\src","sources":["index.tsx"],"mappings":"AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAEtD,MAAMC,aAAa,GAChB,+EAA8E,GAC/ED,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,OAAO,GAAGN,aAAa,CAACM,OAAO;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CACxBC,SAAiB,EACjBC,MAAe,EAImB;EAAA,IAHlCC,QAAgB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,MAAM;EAAA,IACzBG,wBAAiC,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;EAAA,IACzCI,oBAA6B,GAAAJ,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;EAAA,IACpCK,cAAwB,GAAAL,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,GAAG,CAAC;EAChC,IAAIL,OAAO,KAAK,IAAI,EAAE;IACpBW,OAAO,CAACC,KAAK,CAAC,sCAAsC,EAAEhB,aAAa,CAAC;IACpE;EACF;EAEA,IAAID,QAAQ,CAACkB,EAAE,KAAK,SAAS,EAAE;IAC7BF,OAAO,CAACG,IAAI,CAAC,wCAAwC,CAAC;IACtD;EACF;EAEAd,OAAO,CAACC,UAAU,CAACC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,EAAEI,wBAAwB,EAAEC,oBAAoB,EAAEC,cAAc,CAAC;AACjH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASK,eAAeA,CAACC,YAAoB,EAAE;EACpD,IAAIhB,OAAO,KAAK,IAAI,EAAE;IACpBW,OAAO,CAACC,KAAK,CAAC,sCAAsC,EAAEhB,aAAa,CAAC;IACpE;EACF;EAEA,IAAID,QAAQ,CAACkB,EAAE,KAAK,SAAS,EAAE;IAC7BF,OAAO,CAACG,IAAI,CAAC,wCAAwC,CAAC;IACtD;EACF;EAEAd,OAAO,CAACe,eAAe,CAACC,YAAY,CAAC;AACvC;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,mBAAmBA,CAAA,EAAoB;EACrD,IAAIjB,OAAO,KAAK,IAAI,EAAE;IACpBW,OAAO,CAACC,KAAK,CAAC,sCAAsC,EAAEhB,aAAa,CAAC;IACpE,OAAO,IAAIsB,OAAO,CAAEC,OAAO,IAAK;MAC9BA,OAAO,CAAC,WAAW,CAAC;IACtB,CAAC,CAAC;EACJ;EAEA,IAAIxB,QAAQ,CAACkB,EAAE,KAAK,SAAS,EAAE;IAC7BF,OAAO,CAACG,IAAI,CAAC,wCAAwC,CAAC;IACtD,OAAO,IAAII,OAAO,CAAEC,OAAO,IAAK;MAC9BA,OAAO,CAAC,WAAW,CAAC;IACtB,CAAC,CAAC;EACJ;EAEA,OAAOnB,OAAO,CAACiB,mBAAmB,EAAE;AACtC"}
@@ -2,7 +2,7 @@
2
2
  * Initializes the Clarity plugin with the provided parameters.
3
3
  *
4
4
  * @param projectId The Clarity project id to send data to.
5
- * @param userId A custom identifier for the current user. If passed as null, the user id
5
+ * @param userId A custom identifier for the current user. If passed as undefined, the user id
6
6
  * will be auto generated. The user id in general is sticky across sessions.
7
7
  * The provided user id must follow these conditions:
8
8
  * 1. Cannot be an empty string.
@@ -13,7 +13,7 @@
13
13
  * @param allowedDomains The whitelisted domains to allow Clarity to capture their DOM content.
14
14
  * If it contains "*" as an element, all domains will be captured.
15
15
  */
16
- export declare function initialize(projectId: string, userId: string, logLevel: string, allowMeteredNetworkUsage: boolean, enableWebViewCapture: boolean, allowedDomains: string[]): void;
16
+ export declare function initialize(projectId: string, userId?: string, logLevel?: string, allowMeteredNetworkUsage?: boolean, enableWebViewCapture?: boolean, allowedDomains?: string[]): void;
17
17
  /**
18
18
  * Sets a custom user id that can be used to identify the user. It has less
19
19
  * restrictions than the userId parameter. You can pass any string and
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CACxB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,wBAAwB,EAAE,OAAO,EACjC,oBAAoB,EAAE,OAAO,EAC7B,cAAc,EAAE,MAAM,EAAE,QAYzB;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,QAYnD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAAC,MAAM,CAAC,CAgBrD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CACxB,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,MAAM,EACf,QAAQ,GAAE,MAAe,EACzB,wBAAwB,GAAE,OAAe,EACzC,oBAAoB,GAAE,OAAc,EACpC,cAAc,GAAE,MAAM,EAAU,QAYjC;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,QAYnD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAAC,MAAM,CAAC,CAgBrD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-clarity",
3
- "version": "0.0.1-beta.1",
3
+ "version": "0.0.1-beta.3",
4
4
  "description": "A plugin to provide the Clarity experience for the React Native applications.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -47,7 +47,7 @@
47
47
  "bugs": {
48
48
  "url": "https://github.com/microsoft/clarity-apps/issues"
49
49
  },
50
- "homepage": "https://github.com/microsoft/clarity-apps",
50
+ "homepage": "https://clarity.microsoft.com/",
51
51
  "publishConfig": {
52
52
  "registry": "https://registry.npmjs.org/"
53
53
  },
package/src/index.tsx CHANGED
@@ -12,7 +12,7 @@ const Clarity = NativeModules.Clarity;
12
12
  * Initializes the Clarity plugin with the provided parameters.
13
13
  *
14
14
  * @param projectId The Clarity project id to send data to.
15
- * @param userId A custom identifier for the current user. If passed as null, the user id
15
+ * @param userId A custom identifier for the current user. If passed as undefined, the user id
16
16
  * will be auto generated. The user id in general is sticky across sessions.
17
17
  * The provided user id must follow these conditions:
18
18
  * 1. Cannot be an empty string.
@@ -25,11 +25,11 @@ const Clarity = NativeModules.Clarity;
25
25
  */
26
26
  export function initialize(
27
27
  projectId: string,
28
- userId: string,
29
- logLevel: string,
30
- allowMeteredNetworkUsage: boolean,
31
- enableWebViewCapture: boolean,
32
- allowedDomains: string[]) {
28
+ userId?: string,
29
+ logLevel: string = "None",
30
+ allowMeteredNetworkUsage: boolean = false,
31
+ enableWebViewCapture: boolean = true,
32
+ allowedDomains: string[] = ["*"]) {
33
33
  if (Clarity === null) {
34
34
  console.error("Clarity did not initialize properly.", LINKING_ERROR);
35
35
  return;