react-native-clarity 2.2.1 → 2.3.0
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/LICENSE +20 -20
- package/README.md +121 -112
- package/android/build.gradle +81 -81
- package/android/gradle.properties +7 -8
- package/android/src/main/java/com/microsoft/clarity/reactnative/ClarityModule.kt +122 -102
- package/ios/Clarity.h +12 -12
- package/ios/Clarity.mm +15 -15
- package/ios/Clarity.xcodeproj/project.pbxproj +274 -274
- package/lib/commonjs/index.js +104 -55
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +101 -55
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/index.d.ts +13 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +159 -159
- package/react-native-clarity.podspec +35 -35
- package/src/index.tsx +272 -220
- package/ios/Clarity.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -4
package/lib/commonjs/index.js
CHANGED
|
@@ -7,6 +7,9 @@ exports.LogLevel = void 0;
|
|
|
7
7
|
exports.getCurrentSessionId = getCurrentSessionId;
|
|
8
8
|
exports.getCurrentSessionUrl = getCurrentSessionUrl;
|
|
9
9
|
exports.initialize = initialize;
|
|
10
|
+
exports.isPaused = isPaused;
|
|
11
|
+
exports.pause = pause;
|
|
12
|
+
exports.resume = resume;
|
|
10
13
|
exports.setCurrentScreenName = setCurrentScreenName;
|
|
11
14
|
exports.setCustomSessionId = setCustomSessionId;
|
|
12
15
|
exports.setCustomTag = setCustomTag;
|
|
@@ -18,24 +21,24 @@ const LINKING_ERROR = `The package 'react-native-clarity' doesn't seem to be lin
|
|
|
18
21
|
const Clarity = _reactNative.NativeModules.Clarity;
|
|
19
22
|
const SupportedPlatforms = ['android'];
|
|
20
23
|
|
|
21
|
-
/**
|
|
22
|
-
* The configuration that will be used to customize the Clarity behaviour.
|
|
23
|
-
*
|
|
24
|
-
* @param userId [OPTIONAL default = null] A custom identifier for the current user. If passed as null, the user id
|
|
25
|
-
* will be auto generated. The user id in general is sticky across sessions.
|
|
26
|
-
* The provided user id must follow these conditions:
|
|
27
|
-
* 1. Cannot be an empty string.
|
|
28
|
-
* 2. Should be base36 and smaller than "1Z141Z4".
|
|
29
|
-
* @param logLevel [OPTIONAL default = LogLevel.None] The level of logging to show in the device logcat stream.
|
|
30
|
-
* @param allowMeteredNetworkUsage [OPTIONAL default = false] Allows uploading session data to the servers on device metered network.
|
|
31
|
-
* @param enableWebViewCapture [OPTIONAL default = true] Allows Clarity to capture the web views DOM content.
|
|
32
|
-
* @param allowedDomains [OPTIONAL default = ["*"]] The whitelisted domains to allow Clarity to capture their DOM content.
|
|
33
|
-
* If it contains "*" as an element, all domains will be captured.
|
|
34
|
-
* @param disableOnLowEndDevices [OPTIONAL default = false] Disable Clarity on low-end devices.
|
|
35
|
-
* @param maximumDailyNetworkUsageInMB [OPTIONAL default = null] Maximum daily network usage for Clarity (null = No limit). When the limit is reached, Clarity will turn on lean mode.
|
|
24
|
+
/**
|
|
25
|
+
* The configuration that will be used to customize the Clarity behaviour.
|
|
26
|
+
*
|
|
27
|
+
* @param userId [OPTIONAL default = null] A custom identifier for the current user. If passed as null, the user id
|
|
28
|
+
* will be auto generated. The user id in general is sticky across sessions.
|
|
29
|
+
* The provided user id must follow these conditions:
|
|
30
|
+
* 1. Cannot be an empty string.
|
|
31
|
+
* 2. Should be base36 and smaller than "1Z141Z4".
|
|
32
|
+
* @param logLevel [OPTIONAL default = LogLevel.None] The level of logging to show in the device logcat stream.
|
|
33
|
+
* @param allowMeteredNetworkUsage [OPTIONAL default = false] Allows uploading session data to the servers on device metered network.
|
|
34
|
+
* @param enableWebViewCapture [OPTIONAL default = true] Allows Clarity to capture the web views DOM content.
|
|
35
|
+
* @param allowedDomains [OPTIONAL default = ["*"]] The whitelisted domains to allow Clarity to capture their DOM content.
|
|
36
|
+
* If it contains "*" as an element, all domains will be captured.
|
|
37
|
+
* @param disableOnLowEndDevices [OPTIONAL default = false] Disable Clarity on low-end devices.
|
|
38
|
+
* @param maximumDailyNetworkUsageInMB [OPTIONAL default = null] Maximum daily network usage for Clarity (null = No limit). When the limit is reached, Clarity will turn on lean mode.
|
|
36
39
|
*/
|
|
37
|
-
/**
|
|
38
|
-
* The level of logging to show in the device logcat stream.
|
|
40
|
+
/**
|
|
41
|
+
* The level of logging to show in the device logcat stream.
|
|
39
42
|
*/
|
|
40
43
|
let LogLevel = /*#__PURE__*/function (LogLevel) {
|
|
41
44
|
LogLevel["Verbose"] = "Verbose";
|
|
@@ -46,10 +49,10 @@ let LogLevel = /*#__PURE__*/function (LogLevel) {
|
|
|
46
49
|
LogLevel["None"] = "None";
|
|
47
50
|
return LogLevel;
|
|
48
51
|
}({});
|
|
49
|
-
/**
|
|
50
|
-
* Initializes the Clarity SDK if the API level is supported.
|
|
51
|
-
* @param projectId [REQUIRED] The Clarity project id to send data to.
|
|
52
|
-
* @param config [OPTIONAL] The clarity config, if not provided default values are used.
|
|
52
|
+
/**
|
|
53
|
+
* Initializes the Clarity SDK if the API level is supported.
|
|
54
|
+
* @param projectId [REQUIRED] The Clarity project id to send data to.
|
|
55
|
+
* @param config [OPTIONAL] The clarity config, if not provided default values are used.
|
|
53
56
|
*/
|
|
54
57
|
exports.LogLevel = LogLevel;
|
|
55
58
|
function initialize(projectId, config) {
|
|
@@ -82,15 +85,61 @@ function initialize(projectId, config) {
|
|
|
82
85
|
Clarity.initialize(projectId, userId, logLevel, allowMeteredNetworkUsage, enableWebViewCapture, allowedDomains, disableOnLowEndDevices, enableDailyNetworkUsageLimit, refinedMaximumDailyNetworkUsageInMB);
|
|
83
86
|
}
|
|
84
87
|
|
|
85
|
-
/**
|
|
86
|
-
*
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
/**
|
|
89
|
+
* Pauses the Clarity capturing processes until the next resume() is called.
|
|
90
|
+
*/
|
|
91
|
+
function pause() {
|
|
92
|
+
if (!SupportedPlatforms.includes(_reactNative.Platform.OS)) {
|
|
93
|
+
console.warn("Clarity supports " + SupportedPlatforms.join(", ") + " only for now.");
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (Clarity === null) {
|
|
97
|
+
console.error("Clarity did not initialize properly.", LINKING_ERROR);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
Clarity.pause();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Resumes the Clarity capturing processes if they are not already resumed.
|
|
105
|
+
* Note: Clarity starts capturing data right on initialization.
|
|
106
|
+
*/
|
|
107
|
+
function resume() {
|
|
108
|
+
if (!SupportedPlatforms.includes(_reactNative.Platform.OS)) {
|
|
109
|
+
console.warn("Clarity supports " + SupportedPlatforms.join(", ") + " only for now.");
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (Clarity === null) {
|
|
113
|
+
console.error("Clarity did not initialize properly.", LINKING_ERROR);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
Clarity.resume();
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Returns true if Clarity has been paused by the user.
|
|
121
|
+
*/
|
|
122
|
+
function isPaused() {
|
|
123
|
+
if (!SupportedPlatforms.includes(_reactNative.Platform.OS)) {
|
|
124
|
+
console.warn("Clarity supports " + SupportedPlatforms.join(", ") + " only for now.");
|
|
125
|
+
return Promise.resolve(undefined);
|
|
126
|
+
}
|
|
127
|
+
if (Clarity === null) {
|
|
128
|
+
console.error("Clarity did not initialize properly.", LINKING_ERROR);
|
|
129
|
+
return Promise.resolve(undefined);
|
|
130
|
+
}
|
|
131
|
+
return Clarity.isPaused();
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Sets a custom user id that can be used to identify the user. It has less
|
|
136
|
+
* restrictions than the userId parameter. You can pass any string and
|
|
137
|
+
* you can filter on it on the dashboard side. If you need the most efficient
|
|
138
|
+
* filtering on the dashboard, use the userId parameter if possible.
|
|
139
|
+
* <p>
|
|
140
|
+
* Note: custom user id cannot be null or empty, or consists only of whitespaces.
|
|
141
|
+
* </p>
|
|
142
|
+
* @param customUserId The custom user id to set.
|
|
94
143
|
*/
|
|
95
144
|
function setCustomUserId(customUserId) {
|
|
96
145
|
if (!SupportedPlatforms.includes(_reactNative.Platform.OS)) {
|
|
@@ -104,12 +153,12 @@ function setCustomUserId(customUserId) {
|
|
|
104
153
|
Clarity.setCustomUserId(customUserId);
|
|
105
154
|
}
|
|
106
155
|
|
|
107
|
-
/**
|
|
108
|
-
* Sets a custom session id that can be used to identify the session.
|
|
109
|
-
* <p>
|
|
110
|
-
* Note: custom session id cannot be null or empty, or consists only of whitespaces.
|
|
111
|
-
* </p>
|
|
112
|
-
* @param customSessionId The custom session id to set.
|
|
156
|
+
/**
|
|
157
|
+
* Sets a custom session id that can be used to identify the session.
|
|
158
|
+
* <p>
|
|
159
|
+
* Note: custom session id cannot be null or empty, or consists only of whitespaces.
|
|
160
|
+
* </p>
|
|
161
|
+
* @param customSessionId The custom session id to set.
|
|
113
162
|
*/
|
|
114
163
|
function setCustomSessionId(customSessionId) {
|
|
115
164
|
if (!SupportedPlatforms.includes(_reactNative.Platform.OS)) {
|
|
@@ -123,10 +172,10 @@ function setCustomSessionId(customSessionId) {
|
|
|
123
172
|
Clarity.setCustomSessionId(customSessionId);
|
|
124
173
|
}
|
|
125
174
|
|
|
126
|
-
/**
|
|
127
|
-
* Sets a custom tag for the current session.
|
|
128
|
-
* @param key The tag key to set.
|
|
129
|
-
* @param value The tag value to set.
|
|
175
|
+
/**
|
|
176
|
+
* Sets a custom tag for the current session.
|
|
177
|
+
* @param key The tag key to set.
|
|
178
|
+
* @param value The tag value to set.
|
|
130
179
|
*/
|
|
131
180
|
function setCustomTag(key, value) {
|
|
132
181
|
if (!SupportedPlatforms.includes(_reactNative.Platform.OS)) {
|
|
@@ -140,12 +189,12 @@ function setCustomTag(key, value) {
|
|
|
140
189
|
Clarity.setCustomTag(key, value);
|
|
141
190
|
}
|
|
142
191
|
|
|
143
|
-
/**
|
|
144
|
-
* For React Native applications only, this function is used to set the current screen name
|
|
145
|
-
* in case the ReactNative Navigation package is used.
|
|
146
|
-
* This will allow you to split and analyze your data on the screen names.
|
|
147
|
-
* You can it set to `null` to remove the latest set value.
|
|
148
|
-
* @param screenName The current screen name to set.
|
|
192
|
+
/**
|
|
193
|
+
* For React Native applications only, this function is used to set the current screen name
|
|
194
|
+
* in case the ReactNative Navigation package is used.
|
|
195
|
+
* This will allow you to split and analyze your data on the screen names.
|
|
196
|
+
* You can it set to `null` to remove the latest set value.
|
|
197
|
+
* @param screenName The current screen name to set.
|
|
149
198
|
*/
|
|
150
199
|
function setCurrentScreenName(screenName) {
|
|
151
200
|
if (!SupportedPlatforms.includes(_reactNative.Platform.OS)) {
|
|
@@ -159,10 +208,10 @@ function setCurrentScreenName(screenName) {
|
|
|
159
208
|
Clarity.setCurrentScreenName(screenName);
|
|
160
209
|
}
|
|
161
210
|
|
|
162
|
-
/**
|
|
163
|
-
* Returns the active session id. This can be used to correlate the Clarity session with other
|
|
164
|
-
* analytics tools that the developer may be using.
|
|
165
|
-
* @returns a promise that resolves to the current session id.
|
|
211
|
+
/**
|
|
212
|
+
* Returns the active session id. This can be used to correlate the Clarity session with other
|
|
213
|
+
* analytics tools that the developer may be using.
|
|
214
|
+
* @returns a promise that resolves to the current session id.
|
|
166
215
|
*/
|
|
167
216
|
function getCurrentSessionId() {
|
|
168
217
|
if (!SupportedPlatforms.includes(_reactNative.Platform.OS)) {
|
|
@@ -176,11 +225,11 @@ function getCurrentSessionId() {
|
|
|
176
225
|
return Clarity.getCurrentSessionId();
|
|
177
226
|
}
|
|
178
227
|
|
|
179
|
-
/**
|
|
180
|
-
* Returns the active session url. This can be used to correlate the Clarity session with other
|
|
181
|
-
* analytics tools that the developer may be using.
|
|
182
|
-
*
|
|
183
|
-
* @returns a promise that resolves to the current session url if there is an active one.
|
|
228
|
+
/**
|
|
229
|
+
* Returns the active session url. This can be used to correlate the Clarity session with other
|
|
230
|
+
* analytics tools that the developer may be using.
|
|
231
|
+
*
|
|
232
|
+
* @returns a promise that resolves to the current session url if there is an active one.
|
|
184
233
|
*/
|
|
185
234
|
function getCurrentSessionUrl() {
|
|
186
235
|
if (!SupportedPlatforms.includes(_reactNative.Platform.OS)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Clarity","NativeModules","SupportedPlatforms","LogLevel","exports","initialize","projectId","config","Error","userId","logLevel","None","allowMeteredNetworkUsage","enableWebViewCapture","allowedDomains","disableOnLowEndDevices","maximumDailyNetworkUsageInMB","includes","Platform","OS","console","warn","join","error","enableDailyNetworkUsageLimit","refinedMaximumDailyNetworkUsageInMB","setCustomUserId","customUserId","setCustomSessionId","customSessionId","setCustomTag","key","value","setCurrentScreenName","screenName","getCurrentSessionId","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Clarity","NativeModules","SupportedPlatforms","LogLevel","exports","initialize","projectId","config","Error","userId","logLevel","None","allowMeteredNetworkUsage","enableWebViewCapture","allowedDomains","disableOnLowEndDevices","maximumDailyNetworkUsageInMB","includes","Platform","OS","console","warn","join","error","enableDailyNetworkUsageLimit","refinedMaximumDailyNetworkUsageInMB","pause","resume","isPaused","Promise","resolve","undefined","setCustomUserId","customUserId","setCustomSessionId","customSessionId","setCustomTag","key","value","setCurrentScreenName","screenName","getCurrentSessionId","getCurrentSessionUrl"],"sourceRoot":"..\\..\\src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAMC,aAAa,GAChB,+EAA8E;AAC/E;AACA,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,OAAO,GAAGC,0BAAa,CAACD,OAAO;AAErC,MAAME,kBAAkB,GAAG,CAAC,SAAS,CAAC;;AAEtC;AACA;AACA;AACA;AAC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CAAC,CAAC;AACtC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,oBAAoBA,CAAA,EAAoB;EACtD,IAAI,CAACxC,kBAAkB,CAACe,QAAQ,CAACC,qBAAQ,CAACC,EAAE,CAAC,EAAE;IAC7CC,OAAO,CAACC,IAAI,CAAC,mBAAmB,GAAGnB,kBAAkB,CAACoB,IAAI,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC;IACpF,OAAOO,OAAO,CAACC,OAAO,CAAC,WAAW,CAAC;EACrC;EAEA,IAAI9B,OAAO,KAAK,IAAI,EAAE;IACpBoB,OAAO,CAACG,KAAK,CAAC,sCAAsC,EAAExB,aAAa,CAAC;IACpE,OAAO8B,OAAO,CAACC,OAAO,CAAC,WAAW,CAAC;EACrC;EAEA,OAAO9B,OAAO,CAAC0C,oBAAoB,CAAC,CAAC;AACvC"}
|
package/lib/module/index.js
CHANGED
|
@@ -5,25 +5,25 @@ const LINKING_ERROR = `The package 'react-native-clarity' doesn't seem to be lin
|
|
|
5
5
|
const Clarity = NativeModules.Clarity;
|
|
6
6
|
const SupportedPlatforms = ['android'];
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
* The configuration that will be used to customize the Clarity behaviour.
|
|
10
|
-
*
|
|
11
|
-
* @param userId [OPTIONAL default = null] A custom identifier for the current user. If passed as null, the user id
|
|
12
|
-
* will be auto generated. The user id in general is sticky across sessions.
|
|
13
|
-
* The provided user id must follow these conditions:
|
|
14
|
-
* 1. Cannot be an empty string.
|
|
15
|
-
* 2. Should be base36 and smaller than "1Z141Z4".
|
|
16
|
-
* @param logLevel [OPTIONAL default = LogLevel.None] The level of logging to show in the device logcat stream.
|
|
17
|
-
* @param allowMeteredNetworkUsage [OPTIONAL default = false] Allows uploading session data to the servers on device metered network.
|
|
18
|
-
* @param enableWebViewCapture [OPTIONAL default = true] Allows Clarity to capture the web views DOM content.
|
|
19
|
-
* @param allowedDomains [OPTIONAL default = ["*"]] The whitelisted domains to allow Clarity to capture their DOM content.
|
|
20
|
-
* If it contains "*" as an element, all domains will be captured.
|
|
21
|
-
* @param disableOnLowEndDevices [OPTIONAL default = false] Disable Clarity on low-end devices.
|
|
22
|
-
* @param maximumDailyNetworkUsageInMB [OPTIONAL default = null] Maximum daily network usage for Clarity (null = No limit). When the limit is reached, Clarity will turn on lean mode.
|
|
8
|
+
/**
|
|
9
|
+
* The configuration that will be used to customize the Clarity behaviour.
|
|
10
|
+
*
|
|
11
|
+
* @param userId [OPTIONAL default = null] A custom identifier for the current user. If passed as null, the user id
|
|
12
|
+
* will be auto generated. The user id in general is sticky across sessions.
|
|
13
|
+
* The provided user id must follow these conditions:
|
|
14
|
+
* 1. Cannot be an empty string.
|
|
15
|
+
* 2. Should be base36 and smaller than "1Z141Z4".
|
|
16
|
+
* @param logLevel [OPTIONAL default = LogLevel.None] The level of logging to show in the device logcat stream.
|
|
17
|
+
* @param allowMeteredNetworkUsage [OPTIONAL default = false] Allows uploading session data to the servers on device metered network.
|
|
18
|
+
* @param enableWebViewCapture [OPTIONAL default = true] Allows Clarity to capture the web views DOM content.
|
|
19
|
+
* @param allowedDomains [OPTIONAL default = ["*"]] The whitelisted domains to allow Clarity to capture their DOM content.
|
|
20
|
+
* If it contains "*" as an element, all domains will be captured.
|
|
21
|
+
* @param disableOnLowEndDevices [OPTIONAL default = false] Disable Clarity on low-end devices.
|
|
22
|
+
* @param maximumDailyNetworkUsageInMB [OPTIONAL default = null] Maximum daily network usage for Clarity (null = No limit). When the limit is reached, Clarity will turn on lean mode.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
/**
|
|
26
|
-
* The level of logging to show in the device logcat stream.
|
|
25
|
+
/**
|
|
26
|
+
* The level of logging to show in the device logcat stream.
|
|
27
27
|
*/
|
|
28
28
|
export let LogLevel = /*#__PURE__*/function (LogLevel) {
|
|
29
29
|
LogLevel["Verbose"] = "Verbose";
|
|
@@ -35,10 +35,10 @@ export let LogLevel = /*#__PURE__*/function (LogLevel) {
|
|
|
35
35
|
return LogLevel;
|
|
36
36
|
}({});
|
|
37
37
|
|
|
38
|
-
/**
|
|
39
|
-
* Initializes the Clarity SDK if the API level is supported.
|
|
40
|
-
* @param projectId [REQUIRED] The Clarity project id to send data to.
|
|
41
|
-
* @param config [OPTIONAL] The clarity config, if not provided default values are used.
|
|
38
|
+
/**
|
|
39
|
+
* Initializes the Clarity SDK if the API level is supported.
|
|
40
|
+
* @param projectId [REQUIRED] The Clarity project id to send data to.
|
|
41
|
+
* @param config [OPTIONAL] The clarity config, if not provided default values are used.
|
|
42
42
|
*/
|
|
43
43
|
export function initialize(projectId, config) {
|
|
44
44
|
if (typeof projectId !== "string" || !(typeof config === "object" || typeof config === "undefined")) {
|
|
@@ -70,15 +70,61 @@ export function initialize(projectId, config) {
|
|
|
70
70
|
Clarity.initialize(projectId, userId, logLevel, allowMeteredNetworkUsage, enableWebViewCapture, allowedDomains, disableOnLowEndDevices, enableDailyNetworkUsageLimit, refinedMaximumDailyNetworkUsageInMB);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
/**
|
|
74
|
-
*
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
73
|
+
/**
|
|
74
|
+
* Pauses the Clarity capturing processes until the next resume() is called.
|
|
75
|
+
*/
|
|
76
|
+
export function pause() {
|
|
77
|
+
if (!SupportedPlatforms.includes(Platform.OS)) {
|
|
78
|
+
console.warn("Clarity supports " + SupportedPlatforms.join(", ") + " only for now.");
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (Clarity === null) {
|
|
82
|
+
console.error("Clarity did not initialize properly.", LINKING_ERROR);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
Clarity.pause();
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Resumes the Clarity capturing processes if they are not already resumed.
|
|
90
|
+
* Note: Clarity starts capturing data right on initialization.
|
|
91
|
+
*/
|
|
92
|
+
export function resume() {
|
|
93
|
+
if (!SupportedPlatforms.includes(Platform.OS)) {
|
|
94
|
+
console.warn("Clarity supports " + SupportedPlatforms.join(", ") + " only for now.");
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (Clarity === null) {
|
|
98
|
+
console.error("Clarity did not initialize properly.", LINKING_ERROR);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
Clarity.resume();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Returns true if Clarity has been paused by the user.
|
|
106
|
+
*/
|
|
107
|
+
export function isPaused() {
|
|
108
|
+
if (!SupportedPlatforms.includes(Platform.OS)) {
|
|
109
|
+
console.warn("Clarity supports " + SupportedPlatforms.join(", ") + " only for now.");
|
|
110
|
+
return Promise.resolve(undefined);
|
|
111
|
+
}
|
|
112
|
+
if (Clarity === null) {
|
|
113
|
+
console.error("Clarity did not initialize properly.", LINKING_ERROR);
|
|
114
|
+
return Promise.resolve(undefined);
|
|
115
|
+
}
|
|
116
|
+
return Clarity.isPaused();
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Sets a custom user id that can be used to identify the user. It has less
|
|
121
|
+
* restrictions than the userId parameter. You can pass any string and
|
|
122
|
+
* you can filter on it on the dashboard side. If you need the most efficient
|
|
123
|
+
* filtering on the dashboard, use the userId parameter if possible.
|
|
124
|
+
* <p>
|
|
125
|
+
* Note: custom user id cannot be null or empty, or consists only of whitespaces.
|
|
126
|
+
* </p>
|
|
127
|
+
* @param customUserId The custom user id to set.
|
|
82
128
|
*/
|
|
83
129
|
export function setCustomUserId(customUserId) {
|
|
84
130
|
if (!SupportedPlatforms.includes(Platform.OS)) {
|
|
@@ -92,12 +138,12 @@ export function setCustomUserId(customUserId) {
|
|
|
92
138
|
Clarity.setCustomUserId(customUserId);
|
|
93
139
|
}
|
|
94
140
|
|
|
95
|
-
/**
|
|
96
|
-
* Sets a custom session id that can be used to identify the session.
|
|
97
|
-
* <p>
|
|
98
|
-
* Note: custom session id cannot be null or empty, or consists only of whitespaces.
|
|
99
|
-
* </p>
|
|
100
|
-
* @param customSessionId The custom session id to set.
|
|
141
|
+
/**
|
|
142
|
+
* Sets a custom session id that can be used to identify the session.
|
|
143
|
+
* <p>
|
|
144
|
+
* Note: custom session id cannot be null or empty, or consists only of whitespaces.
|
|
145
|
+
* </p>
|
|
146
|
+
* @param customSessionId The custom session id to set.
|
|
101
147
|
*/
|
|
102
148
|
export function setCustomSessionId(customSessionId) {
|
|
103
149
|
if (!SupportedPlatforms.includes(Platform.OS)) {
|
|
@@ -111,10 +157,10 @@ export function setCustomSessionId(customSessionId) {
|
|
|
111
157
|
Clarity.setCustomSessionId(customSessionId);
|
|
112
158
|
}
|
|
113
159
|
|
|
114
|
-
/**
|
|
115
|
-
* Sets a custom tag for the current session.
|
|
116
|
-
* @param key The tag key to set.
|
|
117
|
-
* @param value The tag value to set.
|
|
160
|
+
/**
|
|
161
|
+
* Sets a custom tag for the current session.
|
|
162
|
+
* @param key The tag key to set.
|
|
163
|
+
* @param value The tag value to set.
|
|
118
164
|
*/
|
|
119
165
|
export function setCustomTag(key, value) {
|
|
120
166
|
if (!SupportedPlatforms.includes(Platform.OS)) {
|
|
@@ -128,12 +174,12 @@ export function setCustomTag(key, value) {
|
|
|
128
174
|
Clarity.setCustomTag(key, value);
|
|
129
175
|
}
|
|
130
176
|
|
|
131
|
-
/**
|
|
132
|
-
* For React Native applications only, this function is used to set the current screen name
|
|
133
|
-
* in case the ReactNative Navigation package is used.
|
|
134
|
-
* This will allow you to split and analyze your data on the screen names.
|
|
135
|
-
* You can it set to `null` to remove the latest set value.
|
|
136
|
-
* @param screenName The current screen name to set.
|
|
177
|
+
/**
|
|
178
|
+
* For React Native applications only, this function is used to set the current screen name
|
|
179
|
+
* in case the ReactNative Navigation package is used.
|
|
180
|
+
* This will allow you to split and analyze your data on the screen names.
|
|
181
|
+
* You can it set to `null` to remove the latest set value.
|
|
182
|
+
* @param screenName The current screen name to set.
|
|
137
183
|
*/
|
|
138
184
|
export function setCurrentScreenName(screenName) {
|
|
139
185
|
if (!SupportedPlatforms.includes(Platform.OS)) {
|
|
@@ -147,10 +193,10 @@ export function setCurrentScreenName(screenName) {
|
|
|
147
193
|
Clarity.setCurrentScreenName(screenName);
|
|
148
194
|
}
|
|
149
195
|
|
|
150
|
-
/**
|
|
151
|
-
* Returns the active session id. This can be used to correlate the Clarity session with other
|
|
152
|
-
* analytics tools that the developer may be using.
|
|
153
|
-
* @returns a promise that resolves to the current session id.
|
|
196
|
+
/**
|
|
197
|
+
* Returns the active session id. This can be used to correlate the Clarity session with other
|
|
198
|
+
* analytics tools that the developer may be using.
|
|
199
|
+
* @returns a promise that resolves to the current session id.
|
|
154
200
|
*/
|
|
155
201
|
export function getCurrentSessionId() {
|
|
156
202
|
if (!SupportedPlatforms.includes(Platform.OS)) {
|
|
@@ -164,11 +210,11 @@ export function getCurrentSessionId() {
|
|
|
164
210
|
return Clarity.getCurrentSessionId();
|
|
165
211
|
}
|
|
166
212
|
|
|
167
|
-
/**
|
|
168
|
-
* Returns the active session url. This can be used to correlate the Clarity session with other
|
|
169
|
-
* analytics tools that the developer may be using.
|
|
170
|
-
*
|
|
171
|
-
* @returns a promise that resolves to the current session url if there is an active one.
|
|
213
|
+
/**
|
|
214
|
+
* Returns the active session url. This can be used to correlate the Clarity session with other
|
|
215
|
+
* analytics tools that the developer may be using.
|
|
216
|
+
*
|
|
217
|
+
* @returns a promise that resolves to the current session url if there is an active one.
|
|
172
218
|
*/
|
|
173
219
|
export function getCurrentSessionUrl() {
|
|
174
220
|
if (!SupportedPlatforms.includes(Platform.OS)) {
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","Platform","LINKING_ERROR","Clarity","SupportedPlatforms","LogLevel","initialize","projectId","config","Error","userId","logLevel","None","allowMeteredNetworkUsage","enableWebViewCapture","allowedDomains","disableOnLowEndDevices","maximumDailyNetworkUsageInMB","includes","OS","console","warn","join","error","enableDailyNetworkUsageLimit","refinedMaximumDailyNetworkUsageInMB","setCustomUserId","customUserId","setCustomSessionId","customSessionId","setCustomTag","key","value","setCurrentScreenName","screenName","getCurrentSessionId","
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","LINKING_ERROR","Clarity","SupportedPlatforms","LogLevel","initialize","projectId","config","Error","userId","logLevel","None","allowMeteredNetworkUsage","enableWebViewCapture","allowedDomains","disableOnLowEndDevices","maximumDailyNetworkUsageInMB","includes","OS","console","warn","join","error","enableDailyNetworkUsageLimit","refinedMaximumDailyNetworkUsageInMB","pause","resume","isPaused","Promise","resolve","undefined","setCustomUserId","customUserId","setCustomSessionId","customSessionId","setCustomTag","key","value","setCurrentScreenName","screenName","getCurrentSessionId","getCurrentSessionUrl"],"sourceRoot":"..\\..\\src","sources":["index.tsx"],"mappings":"AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAEtD,MAAMC,aAAa,GAChB,+EAA8E;AAC/E;AACA,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,OAAO,GAAGH,aAAa,CAACG,OAAO;AAErC,MAAMC,kBAAkB,GAAG,CAAC,SAAS,CAAC;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACA,WAAYC,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;;AASpB;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CAACC,SAAiB,EAAEC,MAAsB,EAAE;EAEpE,IAAI,OAAOD,SAAS,KAAK,QAAQ,IAAI,EAAE,OAAOC,MAAM,KAAK,QAAQ,IAAI,OAAOA,MAAM,KAAK,WAAW,CAAC,EAAE;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ACG,KAAK,CAAC,sCAAsC,EAAErB,aAAa,CAAC;IACpE,OAAO2B,OAAO,CAACC,OAAO,CAAC,WAAW,CAAC;EACrC;EAEA,OAAO3B,OAAO,CAACuC,oBAAoB,CAAC,CAAC;AACvC"}
|
|
@@ -40,6 +40,19 @@ export declare enum LogLevel {
|
|
|
40
40
|
* @param config [OPTIONAL] The clarity config, if not provided default values are used.
|
|
41
41
|
*/
|
|
42
42
|
export declare function initialize(projectId: string, config?: ClarityConfig): void;
|
|
43
|
+
/**
|
|
44
|
+
* Pauses the Clarity capturing processes until the next resume() is called.
|
|
45
|
+
*/
|
|
46
|
+
export declare function pause(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Resumes the Clarity capturing processes if they are not already resumed.
|
|
49
|
+
* Note: Clarity starts capturing data right on initialization.
|
|
50
|
+
*/
|
|
51
|
+
export declare function resume(): void;
|
|
52
|
+
/**
|
|
53
|
+
* Returns true if Clarity has been paused by the user.
|
|
54
|
+
*/
|
|
55
|
+
export declare function isPaused(): Promise<Boolean | undefined>;
|
|
43
56
|
/**
|
|
44
57
|
* Sets a custom user id that can be used to identify the user. It has less
|
|
45
58
|
* 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":"AAYA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,4BAA4B,CAAC,EAAE,MAAM,CAAC;CACvC;AAED;;GAEG;AACH,oBAAY,QAAQ;IAClB,OAAO,YAAY;I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