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 +8 -7
- package/android/src/main/java/com/microsoft/clarity/reactnative/ClarityModule.kt +1 -1
- package/lib/commonjs/index.js +6 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +6 -2
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/index.d.ts +2 -2
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/index.tsx +6 -6
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>"
|
|
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
|
|
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
|
|
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
|
package/lib/commonjs/index.js
CHANGED
|
@@ -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
|
|
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
|
|
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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,UAAUA,CACxBC,SAAiB,EACjBC,
|
|
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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,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"}
|
package/lib/module/index.js
CHANGED
|
@@ -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
|
|
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
|
|
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;
|
package/lib/module/index.js.map
CHANGED
|
@@ -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,OAAO,SAASC,UAAUA,CACxBC,SAAiB,EACjBC,
|
|
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,CAA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AAC;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
|
|
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
|
|
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,
|
|
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.
|
|
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://
|
|
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
|
|
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
|
|
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;
|