react-native-clarity 4.5.2 → 4.6.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/README.md +1 -1
- package/ios/Clarity.m +10 -0
- package/package.json +2 -2
- package/react-native-clarity.podspec +1 -1
- package/src/index.tsx +0 -6
- package/lib/commonjs/index.js +0 -378
- package/lib/commonjs/index.js.map +0 -1
- package/lib/module/index.js +0 -357
- package/lib/module/index.js.map +0 -1
- package/lib/typescript/index.d.ts +0 -192
- package/lib/typescript/index.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -103,7 +103,7 @@ Clarity.getCurrentSessionId().then((id) => {...});
|
|
|
103
103
|
// Returns the URL of the current Clarity session recording on the Clarity dashboard if a session has already started; otherwise `null`.
|
|
104
104
|
Clarity.getCurrentSessionUrl().then((url) => {...});
|
|
105
105
|
|
|
106
|
-
// Sets the user's consent status for data collection
|
|
106
|
+
// Sets the user's consent status for data collection.
|
|
107
107
|
Clarity.consent(true, true);
|
|
108
108
|
```
|
|
109
109
|
|
package/ios/Clarity.m
CHANGED
|
@@ -123,6 +123,16 @@ RCT_EXPORT_METHOD(setCurrentScreenName:(NSString *)currentScreenName
|
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
RCT_EXPORT_METHOD(consent:(BOOL)adsStorage
|
|
127
|
+
analyticsStorage:(BOOL)analyticsStorage
|
|
128
|
+
resolver:(RCTPromiseResolveBlock)resolve
|
|
129
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
130
|
+
{
|
|
131
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
132
|
+
resolve(@([ClaritySDK consentWithAnalyticsStorage:analyticsStorage]));
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
|
|
126
136
|
- (ClarityLogLevel)convertLogLevelToEnum:(NSString*)logLevel
|
|
127
137
|
{
|
|
128
138
|
if ([logLevel isEqual:@"Verbose"]) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-clarity",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.0",
|
|
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",
|
|
@@ -163,4 +163,4 @@
|
|
|
163
163
|
]
|
|
164
164
|
]
|
|
165
165
|
}
|
|
166
|
-
}
|
|
166
|
+
}
|
|
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
|
|
|
16
16
|
s.source_files = "ios/**/*.{h,m,mm}"
|
|
17
17
|
|
|
18
18
|
s.dependency "React-Core"
|
|
19
|
-
s.dependency "Clarity", '3.
|
|
19
|
+
s.dependency "Clarity", '3.5.1'
|
|
20
20
|
|
|
21
21
|
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
22
22
|
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
package/src/index.tsx
CHANGED
|
@@ -432,17 +432,11 @@ export function getCurrentSessionUrl(): Promise<string | undefined> {
|
|
|
432
432
|
*
|
|
433
433
|
* **Notes:**
|
|
434
434
|
* - You are responsible for obtaining the user's consent (for example, via a consent banner or another custom solution).
|
|
435
|
-
* - Available on Android only. On iOS the function logs a warning and resolves with `false`.
|
|
436
435
|
*/
|
|
437
436
|
export function consent(
|
|
438
437
|
adsStorage: boolean,
|
|
439
438
|
analyticsStorage: boolean
|
|
440
439
|
): Promise<boolean> {
|
|
441
|
-
if (Platform.OS !== 'android') {
|
|
442
|
-
console.warn('Clarity consent API is only available on Android.');
|
|
443
|
-
return Promise.resolve(false);
|
|
444
|
-
}
|
|
445
|
-
|
|
446
440
|
if (isClarityUnavailable()) {
|
|
447
441
|
return Promise.resolve(false);
|
|
448
442
|
}
|
package/lib/commonjs/index.js
DELETED
|
@@ -1,378 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.LogLevel = void 0;
|
|
7
|
-
exports.consent = consent;
|
|
8
|
-
exports.getCurrentSessionId = getCurrentSessionId;
|
|
9
|
-
exports.getCurrentSessionUrl = getCurrentSessionUrl;
|
|
10
|
-
exports.initialize = initialize;
|
|
11
|
-
exports.isPaused = isPaused;
|
|
12
|
-
exports.pause = pause;
|
|
13
|
-
exports.resume = resume;
|
|
14
|
-
exports.sendCustomEvent = sendCustomEvent;
|
|
15
|
-
exports.setCurrentScreenName = setCurrentScreenName;
|
|
16
|
-
exports.setCustomSessionId = setCustomSessionId;
|
|
17
|
-
exports.setCustomTag = setCustomTag;
|
|
18
|
-
exports.setCustomTags = setCustomTags;
|
|
19
|
-
exports.setCustomUserId = setCustomUserId;
|
|
20
|
-
exports.setOnSessionStartedCallback = setOnSessionStartedCallback;
|
|
21
|
-
exports.startNewSession = startNewSession;
|
|
22
|
-
var _reactNative = require("react-native");
|
|
23
|
-
const LINKING_ERROR = `The package 'react-native-clarity' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
|
24
|
-
ios: "- You have run 'pod install --repo-update'\n",
|
|
25
|
-
default: ''
|
|
26
|
-
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
|
27
|
-
const ReferToDocs = 'Please check the docs at https://www.npmjs.com/package/react-native-clarity for assistance.';
|
|
28
|
-
const Clarity = _reactNative.NativeModules.Clarity;
|
|
29
|
-
const ClarityEmitter = new _reactNative.NativeEventEmitter(_reactNative.NativeModules.ClarityEmitter);
|
|
30
|
-
const SupportedPlatforms = ['android', 'ios'];
|
|
31
|
-
let SupportWarningWasShown = false;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* A class that allows you to configure the Clarity SDK behavior.
|
|
35
|
-
*/
|
|
36
|
-
|
|
37
|
-
const ValidConfigKeys = new Set(Object.keys({
|
|
38
|
-
userId: undefined,
|
|
39
|
-
// Deprecated.
|
|
40
|
-
logLevel: undefined
|
|
41
|
-
}));
|
|
42
|
-
const RemovedDynamicConfigKeys = new Set(['allowMeteredNetworkUsage', 'enableWebViewCapture', 'allowedDomains', 'disableOnLowEndDevices', 'maximumDailyNetworkUsageInMB']);
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* The level of logging to show in the device logging stream.
|
|
46
|
-
*/
|
|
47
|
-
let LogLevel = exports.LogLevel = /*#__PURE__*/function (LogLevel) {
|
|
48
|
-
LogLevel["Verbose"] = "Verbose";
|
|
49
|
-
LogLevel["Debug"] = "Debug";
|
|
50
|
-
LogLevel["Info"] = "Info";
|
|
51
|
-
LogLevel["Warning"] = "Warning";
|
|
52
|
-
LogLevel["Error"] = "Error";
|
|
53
|
-
LogLevel["None"] = "None";
|
|
54
|
-
return LogLevel;
|
|
55
|
-
}({});
|
|
56
|
-
class ClarityError extends Error {
|
|
57
|
-
constructor(message) {
|
|
58
|
-
super(message);
|
|
59
|
-
this.name = 'ClarityError';
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
function isClarityUnavailable() {
|
|
63
|
-
if (!SupportedPlatforms.includes(_reactNative.Platform.OS)) {
|
|
64
|
-
if (!SupportWarningWasShown) {
|
|
65
|
-
console.warn('Clarity supports ' + SupportedPlatforms.join(', ') + ' only for now.');
|
|
66
|
-
SupportWarningWasShown = true;
|
|
67
|
-
}
|
|
68
|
-
return true;
|
|
69
|
-
}
|
|
70
|
-
if (Clarity === null) {
|
|
71
|
-
console.error('Clarity did not initialize properly.', LINKING_ERROR);
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
function validateClarityConfig(config) {
|
|
77
|
-
if (typeof config === 'undefined') {
|
|
78
|
-
// Allow using defaults when config is `null` or `undefined`.
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
if (typeof config !== 'object') {
|
|
82
|
-
throw new ClarityError(`Invalid Clarity initialization \`config\` argument. Expected an object, but received ${typeof config}. ${ReferToDocs}`);
|
|
83
|
-
}
|
|
84
|
-
if (config !== null && config !== void 0 && config.logLevel && !Object.values(LogLevel).includes(config.logLevel)) {
|
|
85
|
-
console.error(`Invalid ClarityConfig \`logLevel\` property value: ${config.logLevel}. Valid values are: ${Object.values(LogLevel).join(', ')}. ${ReferToDocs}`);
|
|
86
|
-
}
|
|
87
|
-
for (const key in config) {
|
|
88
|
-
if (RemovedDynamicConfigKeys.has(key)) {
|
|
89
|
-
throw new ClarityError(`The ClarityConfig \`${key}\` property is removed and it's configurable from Clarity dashboard.`);
|
|
90
|
-
} else if (key === 'enableIOS_experimental') {
|
|
91
|
-
const errorMessage = 'The ClarityConfig `enableIOS_experimental` property is removed and iOS is supported by default.';
|
|
92
|
-
if (config.enableIOS_experimental) {
|
|
93
|
-
// Proceed with initialization if the user intended to enable iOS support.
|
|
94
|
-
console.error(errorMessage);
|
|
95
|
-
} else {
|
|
96
|
-
throw new ClarityError(errorMessage);
|
|
97
|
-
}
|
|
98
|
-
} else if (key === 'userId') {
|
|
99
|
-
console.warn('The ClarityConfig `userId` property is deprecated and would be removed in a future major version. Use `setCustomUserId()` instead.');
|
|
100
|
-
} else if (!ValidConfigKeys.has(key)) {
|
|
101
|
-
console.warn(`Invalid ClarityConfig property: \`${key}\`.`);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* @param projectId - The unique identifier assigned to your Clarity project. You can find it on the **Settings** page of Clarity dashboard. This ID is essential for routing data to the correct Clarity project (required).
|
|
108
|
-
* @param config - Configuration of Clarity that tunes the SDK behavior (for example, which log level to use, and so on).
|
|
109
|
-
*
|
|
110
|
-
* **Notes:**
|
|
111
|
-
* - The initialization function is asynchronous, meaning it returns before Clarity is fully initialized.
|
|
112
|
-
* - For actions that require Clarity to be fully initialized, it's recommended to use the {@linkcode setOnSessionStartedCallback} function.
|
|
113
|
-
*/
|
|
114
|
-
function initialize(projectId, config) {
|
|
115
|
-
if (typeof projectId !== 'string') {
|
|
116
|
-
throw new ClarityError(`Invalid Clarity initialization \`projectId\` argument. Expected a string, but received ${typeof projectId}. ${ReferToDocs}`);
|
|
117
|
-
}
|
|
118
|
-
validateClarityConfig(config);
|
|
119
|
-
|
|
120
|
-
// applying default values
|
|
121
|
-
let {
|
|
122
|
-
userId = null,
|
|
123
|
-
logLevel = LogLevel.None
|
|
124
|
-
} = config ?? {};
|
|
125
|
-
if (isClarityUnavailable()) {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
Clarity.initialize(projectId, userId, logLevel);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Pauses the Clarity session capturing until a call to the {@linkcode resume} function is made.
|
|
133
|
-
*
|
|
134
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if Clarity session capturing was paused successfully; otherwise `false`.
|
|
135
|
-
*/
|
|
136
|
-
function pause() {
|
|
137
|
-
if (isClarityUnavailable()) {
|
|
138
|
-
return Promise.resolve(false);
|
|
139
|
-
}
|
|
140
|
-
return Clarity.pause();
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Resumes the Clarity session capturing only if it was previously paused by a call to the {@linkcode pause} function.
|
|
145
|
-
*
|
|
146
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if Clarity session capturing was resumed successfully; otherwise `false`.
|
|
147
|
-
*/
|
|
148
|
-
function resume() {
|
|
149
|
-
if (isClarityUnavailable()) {
|
|
150
|
-
return Promise.resolve(false);
|
|
151
|
-
}
|
|
152
|
-
return Clarity.resume();
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Checks if Clarity session capturing is currently paused based on an earlier call to the {@linkcode pause} function.
|
|
157
|
-
*
|
|
158
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if Clarity session capturing is currently in the paused state based on an earlier call to the {@linkcode pause} function; otherwise `false`.
|
|
159
|
-
*/
|
|
160
|
-
function isPaused() {
|
|
161
|
-
if (isClarityUnavailable()) {
|
|
162
|
-
return Promise.resolve(false);
|
|
163
|
-
}
|
|
164
|
-
return Clarity.isPaused();
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Forces Clarity to start a new session asynchronously.
|
|
169
|
-
*
|
|
170
|
-
* @param callback - A callback that is invoked when the new session starts. The callback receives the new session ID as a string parameter.
|
|
171
|
-
*
|
|
172
|
-
* **Notes:**
|
|
173
|
-
* - This function is asynchronous, meaning it returns before the new session is started.
|
|
174
|
-
* - Use the {@linkcode callback} parameter to execute logic that needs to run after the new session begins.
|
|
175
|
-
* - Events that occur before invoking the callback are associated with the previous session.
|
|
176
|
-
* - To ensure proper association of custom tags, user ID, or session ID with the new session, set them within the callback.
|
|
177
|
-
*/
|
|
178
|
-
function startNewSession(callback) {
|
|
179
|
-
if (isClarityUnavailable()) {
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
Clarity.startNewSession(callback);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Sets a custom user ID for the current session. This ID can be used to filter sessions on the Clarity dashboard.
|
|
187
|
-
*
|
|
188
|
-
* @param customUserId - The custom user ID to associate with the current session. The value must be a nonempty string, with a maximum length of 255 characters, and can't consist only of whitespace.
|
|
189
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if the custom user ID was set successfully; otherwise `false`.
|
|
190
|
-
*
|
|
191
|
-
* **Notes:**
|
|
192
|
-
* - To ensure that the custom user ID is associated with the correct session, it's recommended to call this function within the callbacks of {@linkcode setOnSessionStartedCallback} or {@linkcode startNewSession}.
|
|
193
|
-
* - Unlike the `userID`, the {@linkcode customUserId} value has fewer restrictions.
|
|
194
|
-
* - We recommend **not** to set any Personally Identifiable Information (PII) values inside this field.
|
|
195
|
-
*/
|
|
196
|
-
function setCustomUserId(customUserId) {
|
|
197
|
-
if (isClarityUnavailable()) {
|
|
198
|
-
return Promise.resolve(false);
|
|
199
|
-
}
|
|
200
|
-
return Clarity.setCustomUserId(customUserId);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* Sets a custom session ID for the current session. This ID can be used to filter sessions on the Clarity dashboard.
|
|
205
|
-
*
|
|
206
|
-
* @param customSessionId - The custom session ID to associate with the current session. The value must be a nonempty string, with a maximum length of 255 characters, and can't consist only of whitespace.
|
|
207
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if the custom session ID was set successfully; otherwise `false`.
|
|
208
|
-
*
|
|
209
|
-
* **Notes:**
|
|
210
|
-
* - To ensure that the custom session ID is associated with the correct session, it's recommended to call this function within the callbacks of {@linkcode setOnSessionStartedCallback} or {@linkcode startNewSession}.
|
|
211
|
-
*/
|
|
212
|
-
function setCustomSessionId(customSessionId) {
|
|
213
|
-
if (isClarityUnavailable()) {
|
|
214
|
-
return Promise.resolve(false);
|
|
215
|
-
}
|
|
216
|
-
return Clarity.setCustomSessionId(customSessionId);
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
/**
|
|
220
|
-
* Sets a custom tag for the current session. This tag can be used to filter sessions on the Clarity dashboard.
|
|
221
|
-
*
|
|
222
|
-
* @param key - The key for the custom tag. The value must be a nonempty string, with a maximum length of 255 characters, and can't consist only of whitespace.
|
|
223
|
-
* @param value - The value for the custom tag. The value must be a nonempty string, with a maximum length of 255 characters, and can't consist only of whitespace.
|
|
224
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if the custom tag was set successfully; otherwise `false`.
|
|
225
|
-
*
|
|
226
|
-
* **Notes:**
|
|
227
|
-
* - To ensure that the custom tag is associated with the correct session, it's recommended to call this function within the callbacks of {@linkcode setOnSessionStartedCallback} or {@linkcode startNewSession}.
|
|
228
|
-
*/
|
|
229
|
-
function setCustomTag(key, value) {
|
|
230
|
-
if (isClarityUnavailable()) {
|
|
231
|
-
return Promise.resolve(false);
|
|
232
|
-
}
|
|
233
|
-
return Clarity.setCustomTag(key, value);
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* Sets custom tags for the current session. These tags can be used to filter sessions on the Clarity dashboard.
|
|
238
|
-
*
|
|
239
|
-
* @param key - The key for the custom tag. The value must be a nonempty string, with a maximum length of 255 characters, and can't consist only of whitespace.
|
|
240
|
-
* @param values - The values for the custom tag. Each value must be a nonempty string, with a maximum length of 255 characters, and can't consist only of whitespace.
|
|
241
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if the custom tag was set successfully; otherwise `false`.
|
|
242
|
-
*
|
|
243
|
-
* **Notes:**
|
|
244
|
-
* - To ensure that the custom tag is associated with the correct session, it's recommended to call this function within the callbacks of {@linkcode setOnSessionStartedCallback} or {@linkcode startNewSession}.
|
|
245
|
-
*/
|
|
246
|
-
function setCustomTags(key, values) {
|
|
247
|
-
if (isClarityUnavailable()) {
|
|
248
|
-
return Promise.resolve(false);
|
|
249
|
-
}
|
|
250
|
-
return Clarity.setCustomTags(key, values);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
/**
|
|
254
|
-
* Sends a custom event to the current Clarity session. These custom events can be used to track specific user interactions or actions that Clarity's built-in event tracking doesn't capture.
|
|
255
|
-
*
|
|
256
|
-
* @param value - The name of the custom event. The value must be a nonempty string, with a maximum length of 254 characters, and can't consist only of whitespace.
|
|
257
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if the custom event was sent successfully; otherwise `false`.
|
|
258
|
-
*
|
|
259
|
-
* **Notes:**
|
|
260
|
-
* - This API can be called multiple times per page to track various user actions.
|
|
261
|
-
* - Each custom event is logged individually and can be filtered, viewed, and analyzed on the Clarity dashboard.
|
|
262
|
-
*/
|
|
263
|
-
function sendCustomEvent(value) {
|
|
264
|
-
if (isClarityUnavailable()) {
|
|
265
|
-
return Promise.resolve(false);
|
|
266
|
-
}
|
|
267
|
-
return Clarity.sendCustomEvent(value);
|
|
268
|
-
}
|
|
269
|
-
let onSessionStartedSubscription = null;
|
|
270
|
-
var onSessionStartedCallback = null;
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* Sets a callback function that's invoked whenever a new Clarity session starts or an existing session is resumed at app startup.
|
|
274
|
-
*
|
|
275
|
-
* @param callback - The callback to be invoked whenever a Clarity session starts. The callback receives the new or resumed session ID as a string parameter.
|
|
276
|
-
* @returns {boolean} `true` if the callback was set successfully; otherwise `false`.
|
|
277
|
-
*
|
|
278
|
-
* **Notes:**
|
|
279
|
-
* - If the callback is set after a session has already started, the callback is invoked right away with the current session ID.
|
|
280
|
-
* - The specified callback is guaranteed to run on the main thread.
|
|
281
|
-
*/
|
|
282
|
-
function setOnSessionStartedCallback(callback) {
|
|
283
|
-
if (isClarityUnavailable()) {
|
|
284
|
-
return false;
|
|
285
|
-
}
|
|
286
|
-
onSessionStartedCallback = callback;
|
|
287
|
-
if (onSessionStartedSubscription === null) {
|
|
288
|
-
onSessionStartedSubscription = ClarityEmitter.addListener('sessionStarted', ({
|
|
289
|
-
sessionId
|
|
290
|
-
}) => {
|
|
291
|
-
if (onSessionStartedCallback !== null) {
|
|
292
|
-
onSessionStartedCallback(sessionId);
|
|
293
|
-
}
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
|
-
return true;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* This function allows you to provide a custom screen name that replaces the default screen name. The default name is automatically generated based on the current activity in Android, or the currently presented view controller's title or type in iOS.
|
|
301
|
-
*
|
|
302
|
-
* @param screenName - The desired screen name. The value must be a nonempty string, with a maximum length of 255 characters, and can't consist only of whitespace. Set to `null` to reset.
|
|
303
|
-
*
|
|
304
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if the specified screen name was set successfully; otherwise `false`.
|
|
305
|
-
*
|
|
306
|
-
* **Example:**
|
|
307
|
-
* - If the presented iOS view controller is a `UIViewController`, and `setCurrentScreenName("Settings")` is called, the screen name is tracked as "Settings".
|
|
308
|
-
* - If `setCurrentScreenName(null)` is called on the same view controller, the screen name is tracked as "UIViewController".
|
|
309
|
-
*
|
|
310
|
-
* **Notes:**
|
|
311
|
-
* - Clarity starts a new page whenever the screen name changes.
|
|
312
|
-
* - To mask or disallow a screen, specify the view controller's type that is displayed as "ViewController" custom tag of the page visit on the Clarity dashboard's recordings. For example, to mask the iOS view controller in the previous example, mask the "&TabBarController" screen instead of "&Settings".
|
|
313
|
-
* - The custom screen name is set globally and persists across all subsequent view controllers until explicitly reset.
|
|
314
|
-
*/
|
|
315
|
-
function setCurrentScreenName(screenName) {
|
|
316
|
-
if (isClarityUnavailable()) {
|
|
317
|
-
return Promise.resolve(false);
|
|
318
|
-
}
|
|
319
|
-
return Clarity.setCurrentScreenName(screenName);
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* @deprecated This function is deprecated and would be removed in a future major version. Use {@linkcode getCurrentSessionUrl} instead.
|
|
324
|
-
*
|
|
325
|
-
* Returns the ID of the currently active Clarity session if a session has already started; otherwise `undefined`.
|
|
326
|
-
*
|
|
327
|
-
* @returns {Promise<string | undefined>} A Promise that resolves with a string representing the ID of the currently active Clarity session if a session has already started; otherwise `undefined`.
|
|
328
|
-
*
|
|
329
|
-
* **Note:**
|
|
330
|
-
* - The session ID can be used to correlate Clarity sessions with other telemetry services.
|
|
331
|
-
* - Initially, this function might return `undefined` until a Clarity session begins.
|
|
332
|
-
* - To ensure a valid session ID, use this method within the callbacks of {@linkcode setOnSessionStartedCallback} or {@linkcode startNewSession}.
|
|
333
|
-
*/
|
|
334
|
-
function getCurrentSessionId() {
|
|
335
|
-
if (isClarityUnavailable()) {
|
|
336
|
-
return Promise.resolve(undefined);
|
|
337
|
-
}
|
|
338
|
-
return Clarity.getCurrentSessionId();
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
/**
|
|
342
|
-
* Returns the URL of the current Clarity session recording on the Clarity dashboard if a session has already started; otherwise `undefined`.
|
|
343
|
-
*
|
|
344
|
-
* @returns {Promise<string | undefined>} A Promise that resolves with a string representing the URL of the current Clarity session recording on the Clarity dashboard if a session has already started; otherwise `undefined`.
|
|
345
|
-
*
|
|
346
|
-
* **Notes:**
|
|
347
|
-
* - Initially, this function might return `undefined` until a Clarity session begins.
|
|
348
|
-
* - To ensure a valid session URL, use this method within the callbacks of {@linkcode setOnSessionStartedCallback} or {@linkcode startNewSession}.
|
|
349
|
-
*/
|
|
350
|
-
function getCurrentSessionUrl() {
|
|
351
|
-
if (isClarityUnavailable()) {
|
|
352
|
-
return Promise.resolve(undefined);
|
|
353
|
-
}
|
|
354
|
-
return Clarity.getCurrentSessionUrl();
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
/**
|
|
358
|
-
* Sets the user's consent status for data collection, which adjusts the SDK's behavior based on the user's choices.
|
|
359
|
-
*
|
|
360
|
-
* @param adsStorage - The user's consent status for ads data collection.
|
|
361
|
-
* @param analyticsStorage - The user's consent status for analytics data collection.
|
|
362
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if the consent status was set successfully; otherwise `false`.
|
|
363
|
-
*
|
|
364
|
-
* **Notes:**
|
|
365
|
-
* - You are responsible for obtaining the user's consent (for example, via a consent banner or another custom solution).
|
|
366
|
-
* - Available on Android only. On iOS the function logs a warning and resolves with `false`.
|
|
367
|
-
*/
|
|
368
|
-
function consent(adsStorage, analyticsStorage) {
|
|
369
|
-
if (_reactNative.Platform.OS !== 'android') {
|
|
370
|
-
console.warn('Clarity consent API is only available on Android.');
|
|
371
|
-
return Promise.resolve(false);
|
|
372
|
-
}
|
|
373
|
-
if (isClarityUnavailable()) {
|
|
374
|
-
return Promise.resolve(false);
|
|
375
|
-
}
|
|
376
|
-
return Clarity.consent(adsStorage, analyticsStorage);
|
|
377
|
-
}
|
|
378
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","ReferToDocs","Clarity","NativeModules","ClarityEmitter","NativeEventEmitter","SupportedPlatforms","SupportWarningWasShown","ValidConfigKeys","Set","Object","keys","userId","undefined","logLevel","RemovedDynamicConfigKeys","LogLevel","exports","ClarityError","Error","constructor","message","name","isClarityUnavailable","includes","OS","console","warn","join","error","validateClarityConfig","config","values","key","has","errorMessage","enableIOS_experimental","initialize","projectId","None","pause","Promise","resolve","resume","isPaused","startNewSession","callback","setCustomUserId","customUserId","setCustomSessionId","customSessionId","setCustomTag","value","setCustomTags","sendCustomEvent","onSessionStartedSubscription","onSessionStartedCallback","setOnSessionStartedCallback","addListener","sessionId","setCurrentScreenName","screenName","getCurrentSessionId","getCurrentSessionUrl","consent","adsStorage","analyticsStorage"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAOA,MAAMC,aAAa,GACjB,+EAA+E,GAC/EC,qBAAQ,CAACC,MAAM,CAAC;EACdC,GAAG,EAAE,8CAA8C;EACnDC,OAAO,EAAE;AACX,CAAC,CAAC,GACF,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,WAAW,GACf,6FAA6F;AAE/F,MAAMC,OAAO,GAAGC,0BAAa,CAACD,OAAO;AACrC,MAAME,cAAc,GAAG,IAAIC,+BAAkB,CAACF,0BAAa,CAACC,cAAc,CAAC;AAE3E,MAAME,kBAAkB,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC;AAE7C,IAAIC,sBAAsB,GAAG,KAAK;;AAElC;AACA;AACA;;AAuBA,MAAMC,eAAe,GAAG,IAAIC,GAAG,CAC7BC,MAAM,CAACC,IAAI,CAAC;EACVC,MAAM,EAAEC,SAAS;EAAE;EACnBC,QAAQ,EAAED;AACZ,CAAkB,CACpB,CAAC;AAED,MAAME,wBAAwB,GAAG,IAAIN,GAAG,CAAC,CACvC,0BAA0B,EAC1B,sBAAsB,EACtB,gBAAgB,EAChB,wBAAwB,EACxB,8BAA8B,CAC/B,CAAC;;AAEF;AACA;A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AO,CAACC,OAAO,CAAC,KAAK,CAAC;EAC/B;EAEA,IAAInB,oBAAoB,CAAC,CAAC,EAAE;IAC1B,OAAOkB,OAAO,CAACC,OAAO,CAAC,KAAK,CAAC;EAC/B;EAEA,OAAOxC,OAAO,CAAC8D,OAAO,CAACC,UAAU,EAAEC,gBAAgB,CAAC;AACtD","ignoreList":[]}
|
package/lib/module/index.js
DELETED
|
@@ -1,357 +0,0 @@
|
|
|
1
|
-
import { NativeModules, NativeEventEmitter, Platform } from 'react-native';
|
|
2
|
-
const LINKING_ERROR = `The package 'react-native-clarity' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
|
|
3
|
-
ios: "- You have run 'pod install --repo-update'\n",
|
|
4
|
-
default: ''
|
|
5
|
-
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
|
6
|
-
const ReferToDocs = 'Please check the docs at https://www.npmjs.com/package/react-native-clarity for assistance.';
|
|
7
|
-
const Clarity = NativeModules.Clarity;
|
|
8
|
-
const ClarityEmitter = new NativeEventEmitter(NativeModules.ClarityEmitter);
|
|
9
|
-
const SupportedPlatforms = ['android', 'ios'];
|
|
10
|
-
let SupportWarningWasShown = false;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* A class that allows you to configure the Clarity SDK behavior.
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
const ValidConfigKeys = new Set(Object.keys({
|
|
17
|
-
userId: undefined,
|
|
18
|
-
// Deprecated.
|
|
19
|
-
logLevel: undefined
|
|
20
|
-
}));
|
|
21
|
-
const RemovedDynamicConfigKeys = new Set(['allowMeteredNetworkUsage', 'enableWebViewCapture', 'allowedDomains', 'disableOnLowEndDevices', 'maximumDailyNetworkUsageInMB']);
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* The level of logging to show in the device logging stream.
|
|
25
|
-
*/
|
|
26
|
-
export let LogLevel = /*#__PURE__*/function (LogLevel) {
|
|
27
|
-
LogLevel["Verbose"] = "Verbose";
|
|
28
|
-
LogLevel["Debug"] = "Debug";
|
|
29
|
-
LogLevel["Info"] = "Info";
|
|
30
|
-
LogLevel["Warning"] = "Warning";
|
|
31
|
-
LogLevel["Error"] = "Error";
|
|
32
|
-
LogLevel["None"] = "None";
|
|
33
|
-
return LogLevel;
|
|
34
|
-
}({});
|
|
35
|
-
class ClarityError extends Error {
|
|
36
|
-
constructor(message) {
|
|
37
|
-
super(message);
|
|
38
|
-
this.name = 'ClarityError';
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
function isClarityUnavailable() {
|
|
42
|
-
if (!SupportedPlatforms.includes(Platform.OS)) {
|
|
43
|
-
if (!SupportWarningWasShown) {
|
|
44
|
-
console.warn('Clarity supports ' + SupportedPlatforms.join(', ') + ' only for now.');
|
|
45
|
-
SupportWarningWasShown = true;
|
|
46
|
-
}
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
if (Clarity === null) {
|
|
50
|
-
console.error('Clarity did not initialize properly.', LINKING_ERROR);
|
|
51
|
-
return true;
|
|
52
|
-
}
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
function validateClarityConfig(config) {
|
|
56
|
-
if (typeof config === 'undefined') {
|
|
57
|
-
// Allow using defaults when config is `null` or `undefined`.
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
if (typeof config !== 'object') {
|
|
61
|
-
throw new ClarityError(`Invalid Clarity initialization \`config\` argument. Expected an object, but received ${typeof config}. ${ReferToDocs}`);
|
|
62
|
-
}
|
|
63
|
-
if (config !== null && config !== void 0 && config.logLevel && !Object.values(LogLevel).includes(config.logLevel)) {
|
|
64
|
-
console.error(`Invalid ClarityConfig \`logLevel\` property value: ${config.logLevel}. Valid values are: ${Object.values(LogLevel).join(', ')}. ${ReferToDocs}`);
|
|
65
|
-
}
|
|
66
|
-
for (const key in config) {
|
|
67
|
-
if (RemovedDynamicConfigKeys.has(key)) {
|
|
68
|
-
throw new ClarityError(`The ClarityConfig \`${key}\` property is removed and it's configurable from Clarity dashboard.`);
|
|
69
|
-
} else if (key === 'enableIOS_experimental') {
|
|
70
|
-
const errorMessage = 'The ClarityConfig `enableIOS_experimental` property is removed and iOS is supported by default.';
|
|
71
|
-
if (config.enableIOS_experimental) {
|
|
72
|
-
// Proceed with initialization if the user intended to enable iOS support.
|
|
73
|
-
console.error(errorMessage);
|
|
74
|
-
} else {
|
|
75
|
-
throw new ClarityError(errorMessage);
|
|
76
|
-
}
|
|
77
|
-
} else if (key === 'userId') {
|
|
78
|
-
console.warn('The ClarityConfig `userId` property is deprecated and would be removed in a future major version. Use `setCustomUserId()` instead.');
|
|
79
|
-
} else if (!ValidConfigKeys.has(key)) {
|
|
80
|
-
console.warn(`Invalid ClarityConfig property: \`${key}\`.`);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* @param projectId - The unique identifier assigned to your Clarity project. You can find it on the **Settings** page of Clarity dashboard. This ID is essential for routing data to the correct Clarity project (required).
|
|
87
|
-
* @param config - Configuration of Clarity that tunes the SDK behavior (for example, which log level to use, and so on).
|
|
88
|
-
*
|
|
89
|
-
* **Notes:**
|
|
90
|
-
* - The initialization function is asynchronous, meaning it returns before Clarity is fully initialized.
|
|
91
|
-
* - For actions that require Clarity to be fully initialized, it's recommended to use the {@linkcode setOnSessionStartedCallback} function.
|
|
92
|
-
*/
|
|
93
|
-
export function initialize(projectId, config) {
|
|
94
|
-
if (typeof projectId !== 'string') {
|
|
95
|
-
throw new ClarityError(`Invalid Clarity initialization \`projectId\` argument. Expected a string, but received ${typeof projectId}. ${ReferToDocs}`);
|
|
96
|
-
}
|
|
97
|
-
validateClarityConfig(config);
|
|
98
|
-
|
|
99
|
-
// applying default values
|
|
100
|
-
let {
|
|
101
|
-
userId = null,
|
|
102
|
-
logLevel = LogLevel.None
|
|
103
|
-
} = config ?? {};
|
|
104
|
-
if (isClarityUnavailable()) {
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
Clarity.initialize(projectId, userId, logLevel);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Pauses the Clarity session capturing until a call to the {@linkcode resume} function is made.
|
|
112
|
-
*
|
|
113
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if Clarity session capturing was paused successfully; otherwise `false`.
|
|
114
|
-
*/
|
|
115
|
-
export function pause() {
|
|
116
|
-
if (isClarityUnavailable()) {
|
|
117
|
-
return Promise.resolve(false);
|
|
118
|
-
}
|
|
119
|
-
return Clarity.pause();
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Resumes the Clarity session capturing only if it was previously paused by a call to the {@linkcode pause} function.
|
|
124
|
-
*
|
|
125
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if Clarity session capturing was resumed successfully; otherwise `false`.
|
|
126
|
-
*/
|
|
127
|
-
export function resume() {
|
|
128
|
-
if (isClarityUnavailable()) {
|
|
129
|
-
return Promise.resolve(false);
|
|
130
|
-
}
|
|
131
|
-
return Clarity.resume();
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Checks if Clarity session capturing is currently paused based on an earlier call to the {@linkcode pause} function.
|
|
136
|
-
*
|
|
137
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if Clarity session capturing is currently in the paused state based on an earlier call to the {@linkcode pause} function; otherwise `false`.
|
|
138
|
-
*/
|
|
139
|
-
export function isPaused() {
|
|
140
|
-
if (isClarityUnavailable()) {
|
|
141
|
-
return Promise.resolve(false);
|
|
142
|
-
}
|
|
143
|
-
return Clarity.isPaused();
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Forces Clarity to start a new session asynchronously.
|
|
148
|
-
*
|
|
149
|
-
* @param callback - A callback that is invoked when the new session starts. The callback receives the new session ID as a string parameter.
|
|
150
|
-
*
|
|
151
|
-
* **Notes:**
|
|
152
|
-
* - This function is asynchronous, meaning it returns before the new session is started.
|
|
153
|
-
* - Use the {@linkcode callback} parameter to execute logic that needs to run after the new session begins.
|
|
154
|
-
* - Events that occur before invoking the callback are associated with the previous session.
|
|
155
|
-
* - To ensure proper association of custom tags, user ID, or session ID with the new session, set them within the callback.
|
|
156
|
-
*/
|
|
157
|
-
export function startNewSession(callback) {
|
|
158
|
-
if (isClarityUnavailable()) {
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
Clarity.startNewSession(callback);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Sets a custom user ID for the current session. This ID can be used to filter sessions on the Clarity dashboard.
|
|
166
|
-
*
|
|
167
|
-
* @param customUserId - The custom user ID to associate with the current session. The value must be a nonempty string, with a maximum length of 255 characters, and can't consist only of whitespace.
|
|
168
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if the custom user ID was set successfully; otherwise `false`.
|
|
169
|
-
*
|
|
170
|
-
* **Notes:**
|
|
171
|
-
* - To ensure that the custom user ID is associated with the correct session, it's recommended to call this function within the callbacks of {@linkcode setOnSessionStartedCallback} or {@linkcode startNewSession}.
|
|
172
|
-
* - Unlike the `userID`, the {@linkcode customUserId} value has fewer restrictions.
|
|
173
|
-
* - We recommend **not** to set any Personally Identifiable Information (PII) values inside this field.
|
|
174
|
-
*/
|
|
175
|
-
export function setCustomUserId(customUserId) {
|
|
176
|
-
if (isClarityUnavailable()) {
|
|
177
|
-
return Promise.resolve(false);
|
|
178
|
-
}
|
|
179
|
-
return Clarity.setCustomUserId(customUserId);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Sets a custom session ID for the current session. This ID can be used to filter sessions on the Clarity dashboard.
|
|
184
|
-
*
|
|
185
|
-
* @param customSessionId - The custom session ID to associate with the current session. The value must be a nonempty string, with a maximum length of 255 characters, and can't consist only of whitespace.
|
|
186
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if the custom session ID was set successfully; otherwise `false`.
|
|
187
|
-
*
|
|
188
|
-
* **Notes:**
|
|
189
|
-
* - To ensure that the custom session ID is associated with the correct session, it's recommended to call this function within the callbacks of {@linkcode setOnSessionStartedCallback} or {@linkcode startNewSession}.
|
|
190
|
-
*/
|
|
191
|
-
export function setCustomSessionId(customSessionId) {
|
|
192
|
-
if (isClarityUnavailable()) {
|
|
193
|
-
return Promise.resolve(false);
|
|
194
|
-
}
|
|
195
|
-
return Clarity.setCustomSessionId(customSessionId);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/**
|
|
199
|
-
* Sets a custom tag for the current session. This tag can be used to filter sessions on the Clarity dashboard.
|
|
200
|
-
*
|
|
201
|
-
* @param key - The key for the custom tag. The value must be a nonempty string, with a maximum length of 255 characters, and can't consist only of whitespace.
|
|
202
|
-
* @param value - The value for the custom tag. The value must be a nonempty string, with a maximum length of 255 characters, and can't consist only of whitespace.
|
|
203
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if the custom tag was set successfully; otherwise `false`.
|
|
204
|
-
*
|
|
205
|
-
* **Notes:**
|
|
206
|
-
* - To ensure that the custom tag is associated with the correct session, it's recommended to call this function within the callbacks of {@linkcode setOnSessionStartedCallback} or {@linkcode startNewSession}.
|
|
207
|
-
*/
|
|
208
|
-
export function setCustomTag(key, value) {
|
|
209
|
-
if (isClarityUnavailable()) {
|
|
210
|
-
return Promise.resolve(false);
|
|
211
|
-
}
|
|
212
|
-
return Clarity.setCustomTag(key, value);
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* Sets custom tags for the current session. These tags can be used to filter sessions on the Clarity dashboard.
|
|
217
|
-
*
|
|
218
|
-
* @param key - The key for the custom tag. The value must be a nonempty string, with a maximum length of 255 characters, and can't consist only of whitespace.
|
|
219
|
-
* @param values - The values for the custom tag. Each value must be a nonempty string, with a maximum length of 255 characters, and can't consist only of whitespace.
|
|
220
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if the custom tag was set successfully; otherwise `false`.
|
|
221
|
-
*
|
|
222
|
-
* **Notes:**
|
|
223
|
-
* - To ensure that the custom tag is associated with the correct session, it's recommended to call this function within the callbacks of {@linkcode setOnSessionStartedCallback} or {@linkcode startNewSession}.
|
|
224
|
-
*/
|
|
225
|
-
export function setCustomTags(key, values) {
|
|
226
|
-
if (isClarityUnavailable()) {
|
|
227
|
-
return Promise.resolve(false);
|
|
228
|
-
}
|
|
229
|
-
return Clarity.setCustomTags(key, values);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* Sends a custom event to the current Clarity session. These custom events can be used to track specific user interactions or actions that Clarity's built-in event tracking doesn't capture.
|
|
234
|
-
*
|
|
235
|
-
* @param value - The name of the custom event. The value must be a nonempty string, with a maximum length of 254 characters, and can't consist only of whitespace.
|
|
236
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if the custom event was sent successfully; otherwise `false`.
|
|
237
|
-
*
|
|
238
|
-
* **Notes:**
|
|
239
|
-
* - This API can be called multiple times per page to track various user actions.
|
|
240
|
-
* - Each custom event is logged individually and can be filtered, viewed, and analyzed on the Clarity dashboard.
|
|
241
|
-
*/
|
|
242
|
-
export function sendCustomEvent(value) {
|
|
243
|
-
if (isClarityUnavailable()) {
|
|
244
|
-
return Promise.resolve(false);
|
|
245
|
-
}
|
|
246
|
-
return Clarity.sendCustomEvent(value);
|
|
247
|
-
}
|
|
248
|
-
let onSessionStartedSubscription = null;
|
|
249
|
-
var onSessionStartedCallback = null;
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* Sets a callback function that's invoked whenever a new Clarity session starts or an existing session is resumed at app startup.
|
|
253
|
-
*
|
|
254
|
-
* @param callback - The callback to be invoked whenever a Clarity session starts. The callback receives the new or resumed session ID as a string parameter.
|
|
255
|
-
* @returns {boolean} `true` if the callback was set successfully; otherwise `false`.
|
|
256
|
-
*
|
|
257
|
-
* **Notes:**
|
|
258
|
-
* - If the callback is set after a session has already started, the callback is invoked right away with the current session ID.
|
|
259
|
-
* - The specified callback is guaranteed to run on the main thread.
|
|
260
|
-
*/
|
|
261
|
-
export function setOnSessionStartedCallback(callback) {
|
|
262
|
-
if (isClarityUnavailable()) {
|
|
263
|
-
return false;
|
|
264
|
-
}
|
|
265
|
-
onSessionStartedCallback = callback;
|
|
266
|
-
if (onSessionStartedSubscription === null) {
|
|
267
|
-
onSessionStartedSubscription = ClarityEmitter.addListener('sessionStarted', ({
|
|
268
|
-
sessionId
|
|
269
|
-
}) => {
|
|
270
|
-
if (onSessionStartedCallback !== null) {
|
|
271
|
-
onSessionStartedCallback(sessionId);
|
|
272
|
-
}
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
return true;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* This function allows you to provide a custom screen name that replaces the default screen name. The default name is automatically generated based on the current activity in Android, or the currently presented view controller's title or type in iOS.
|
|
280
|
-
*
|
|
281
|
-
* @param screenName - The desired screen name. The value must be a nonempty string, with a maximum length of 255 characters, and can't consist only of whitespace. Set to `null` to reset.
|
|
282
|
-
*
|
|
283
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if the specified screen name was set successfully; otherwise `false`.
|
|
284
|
-
*
|
|
285
|
-
* **Example:**
|
|
286
|
-
* - If the presented iOS view controller is a `UIViewController`, and `setCurrentScreenName("Settings")` is called, the screen name is tracked as "Settings".
|
|
287
|
-
* - If `setCurrentScreenName(null)` is called on the same view controller, the screen name is tracked as "UIViewController".
|
|
288
|
-
*
|
|
289
|
-
* **Notes:**
|
|
290
|
-
* - Clarity starts a new page whenever the screen name changes.
|
|
291
|
-
* - To mask or disallow a screen, specify the view controller's type that is displayed as "ViewController" custom tag of the page visit on the Clarity dashboard's recordings. For example, to mask the iOS view controller in the previous example, mask the "&TabBarController" screen instead of "&Settings".
|
|
292
|
-
* - The custom screen name is set globally and persists across all subsequent view controllers until explicitly reset.
|
|
293
|
-
*/
|
|
294
|
-
export function setCurrentScreenName(screenName) {
|
|
295
|
-
if (isClarityUnavailable()) {
|
|
296
|
-
return Promise.resolve(false);
|
|
297
|
-
}
|
|
298
|
-
return Clarity.setCurrentScreenName(screenName);
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* @deprecated This function is deprecated and would be removed in a future major version. Use {@linkcode getCurrentSessionUrl} instead.
|
|
303
|
-
*
|
|
304
|
-
* Returns the ID of the currently active Clarity session if a session has already started; otherwise `undefined`.
|
|
305
|
-
*
|
|
306
|
-
* @returns {Promise<string | undefined>} A Promise that resolves with a string representing the ID of the currently active Clarity session if a session has already started; otherwise `undefined`.
|
|
307
|
-
*
|
|
308
|
-
* **Note:**
|
|
309
|
-
* - The session ID can be used to correlate Clarity sessions with other telemetry services.
|
|
310
|
-
* - Initially, this function might return `undefined` until a Clarity session begins.
|
|
311
|
-
* - To ensure a valid session ID, use this method within the callbacks of {@linkcode setOnSessionStartedCallback} or {@linkcode startNewSession}.
|
|
312
|
-
*/
|
|
313
|
-
export function getCurrentSessionId() {
|
|
314
|
-
if (isClarityUnavailable()) {
|
|
315
|
-
return Promise.resolve(undefined);
|
|
316
|
-
}
|
|
317
|
-
return Clarity.getCurrentSessionId();
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
/**
|
|
321
|
-
* Returns the URL of the current Clarity session recording on the Clarity dashboard if a session has already started; otherwise `undefined`.
|
|
322
|
-
*
|
|
323
|
-
* @returns {Promise<string | undefined>} A Promise that resolves with a string representing the URL of the current Clarity session recording on the Clarity dashboard if a session has already started; otherwise `undefined`.
|
|
324
|
-
*
|
|
325
|
-
* **Notes:**
|
|
326
|
-
* - Initially, this function might return `undefined` until a Clarity session begins.
|
|
327
|
-
* - To ensure a valid session URL, use this method within the callbacks of {@linkcode setOnSessionStartedCallback} or {@linkcode startNewSession}.
|
|
328
|
-
*/
|
|
329
|
-
export function getCurrentSessionUrl() {
|
|
330
|
-
if (isClarityUnavailable()) {
|
|
331
|
-
return Promise.resolve(undefined);
|
|
332
|
-
}
|
|
333
|
-
return Clarity.getCurrentSessionUrl();
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
/**
|
|
337
|
-
* Sets the user's consent status for data collection, which adjusts the SDK's behavior based on the user's choices.
|
|
338
|
-
*
|
|
339
|
-
* @param adsStorage - The user's consent status for ads data collection.
|
|
340
|
-
* @param analyticsStorage - The user's consent status for analytics data collection.
|
|
341
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if the consent status was set successfully; otherwise `false`.
|
|
342
|
-
*
|
|
343
|
-
* **Notes:**
|
|
344
|
-
* - You are responsible for obtaining the user's consent (for example, via a consent banner or another custom solution).
|
|
345
|
-
* - Available on Android only. On iOS the function logs a warning and resolves with `false`.
|
|
346
|
-
*/
|
|
347
|
-
export function consent(adsStorage, analyticsStorage) {
|
|
348
|
-
if (Platform.OS !== 'android') {
|
|
349
|
-
console.warn('Clarity consent API is only available on Android.');
|
|
350
|
-
return Promise.resolve(false);
|
|
351
|
-
}
|
|
352
|
-
if (isClarityUnavailable()) {
|
|
353
|
-
return Promise.resolve(false);
|
|
354
|
-
}
|
|
355
|
-
return Clarity.consent(adsStorage, analyticsStorage);
|
|
356
|
-
}
|
|
357
|
-
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","NativeEventEmitter","Platform","LINKING_ERROR","select","ios","default","ReferToDocs","Clarity","ClarityEmitter","SupportedPlatforms","SupportWarningWasShown","ValidConfigKeys","Set","Object","keys","userId","undefined","logLevel","RemovedDynamicConfigKeys","LogLevel","ClarityError","Error","constructor","message","name","isClarityUnavailable","includes","OS","console","warn","join","error","validateClarityConfig","config","values","key","has","errorMessage","enableIOS_experimental","initialize","projectId","None","pause","Promise","resolve","resume","isPaused","startNewSession","callback","setCustomUserId","customUserId","setCustomSessionId","customSessionId","setCustomTag","value","setCustomTags","sendCustomEvent","onSessionStartedSubscription","onSessionStartedCallback","setOnSessionStartedCallback","addListener","sessionId","setCurrentScreenName","screenName","getCurrentSessionId","getCurrentSessionUrl","consent","adsStorage","analyticsStorage"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SACEA,aAAa,EACbC,kBAAkB,EAClBC,QAAQ,QAEH,cAAc;AAErB,MAAMC,aAAa,GACjB,+EAA+E,GAC/ED,QAAQ,CAACE,MAAM,CAAC;EACdC,GAAG,EAAE,8CAA8C;EACnDC,OAAO,EAAE;AACX,CAAC,CAAC,GACF,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,WAAW,GACf,6FAA6F;AAE/F,MAAMC,OAAO,GAAGR,aAAa,CAACQ,OAAO;AACrC,MAAMC,cAAc,GAAG,IAAIR,kBAAkB,CAACD,aAAa,CAACS,cAAc,CAAC;AAE3E,MAAMC,kBAAkB,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC;AAE7C,IAAIC,sBAAsB,GAAG,KAAK;;AAElC;AACA;AACA;;AAuBA,MAAMC,eAAe,GAAG,IAAIC,GAAG,CAC7BC,MAAM,CAACC,IAAI,CAAC;EACVC,MAAM,EAAEC,SAAS;EAAE;EACnBC,QAAQ,EAAED;AACZ,CAAkB,CACpB,CAAC;AAED,MAAME,wBAAwB,GAAG,IAAIN,GAAG,CAAC,CACvC,0BAA0B,EAC1B,sBAAsB,EACtB,gBAAgB,EAChB,wBAAwB,EACxB,8BAA8B,CAC/B,CAAC;;AAEF;AACA;AACA;AACA,WAAYO,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AASpB,MAAMC,YAAY,SAASC,KAAK,CAAC;EAC/BC,WAAWA,CAACC,OAAe,EAAE;IAC3B,KAAK,CAACA,OAAO,CAAC;IACd,IAAI,CAACC,IAAI,GAAG,cAAc;EAC5B;AACF;AAEA,SAASC,oBAAoBA,CAAA,EA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|
2
|
-
* A class that allows you to configure the Clarity SDK behavior.
|
|
3
|
-
*/
|
|
4
|
-
export interface ClarityConfig {
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated This property is deprecated and would be removed in a future major version. Use {@linkcode setCustomSessionId} instead.
|
|
7
|
-
*
|
|
8
|
-
* The unique identifier associated with the application user. This ID persists across multiple sessions on the same device.
|
|
9
|
-
*
|
|
10
|
-
* **Notes:**
|
|
11
|
-
* - If {@linkcode userId} isn't provided, a random one is generated automatically.
|
|
12
|
-
* - Must be a base-36 string smaller than `1Z141Z4`.
|
|
13
|
-
* - If an invalid {@linkcode userId} is supplied:
|
|
14
|
-
* - If `customUserId` isn't specified, {@linkcode userId} acts as the `customUserId`, and a new random {@linkcode userId} is assigned.
|
|
15
|
-
* - If `customUserId` is specified, the invalid {@linkcode userID} is ignored.
|
|
16
|
-
* - For more flexibility in user identification, consider using the {@linkcode setCustomUserId} API. However, keep in mind that `customUserId` length must be between 1 and 255 characters.
|
|
17
|
-
*/
|
|
18
|
-
userId?: string;
|
|
19
|
-
/**
|
|
20
|
-
* The level of logging to show in the device’s logging stream while debugging. By default, the SDK logs nothing.
|
|
21
|
-
*/
|
|
22
|
-
logLevel?: LogLevel;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* The level of logging to show in the device logging stream.
|
|
26
|
-
*/
|
|
27
|
-
export declare enum LogLevel {
|
|
28
|
-
Verbose = "Verbose",
|
|
29
|
-
Debug = "Debug",
|
|
30
|
-
Info = "Info",
|
|
31
|
-
Warning = "Warning",
|
|
32
|
-
Error = "Error",
|
|
33
|
-
None = "None"
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* @param projectId - The unique identifier assigned to your Clarity project. You can find it on the **Settings** page of Clarity dashboard. This ID is essential for routing data to the correct Clarity project (required).
|
|
37
|
-
* @param config - Configuration of Clarity that tunes the SDK behavior (for example, which log level to use, and so on).
|
|
38
|
-
*
|
|
39
|
-
* **Notes:**
|
|
40
|
-
* - The initialization function is asynchronous, meaning it returns before Clarity is fully initialized.
|
|
41
|
-
* - For actions that require Clarity to be fully initialized, it's recommended to use the {@linkcode setOnSessionStartedCallback} function.
|
|
42
|
-
*/
|
|
43
|
-
export declare function initialize(projectId: string, config?: ClarityConfig): void;
|
|
44
|
-
/**
|
|
45
|
-
* Pauses the Clarity session capturing until a call to the {@linkcode resume} function is made.
|
|
46
|
-
*
|
|
47
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if Clarity session capturing was paused successfully; otherwise `false`.
|
|
48
|
-
*/
|
|
49
|
-
export declare function pause(): Promise<boolean>;
|
|
50
|
-
/**
|
|
51
|
-
* Resumes the Clarity session capturing only if it was previously paused by a call to the {@linkcode pause} function.
|
|
52
|
-
*
|
|
53
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if Clarity session capturing was resumed successfully; otherwise `false`.
|
|
54
|
-
*/
|
|
55
|
-
export declare function resume(): Promise<boolean>;
|
|
56
|
-
/**
|
|
57
|
-
* Checks if Clarity session capturing is currently paused based on an earlier call to the {@linkcode pause} function.
|
|
58
|
-
*
|
|
59
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if Clarity session capturing is currently in the paused state based on an earlier call to the {@linkcode pause} function; otherwise `false`.
|
|
60
|
-
*/
|
|
61
|
-
export declare function isPaused(): Promise<boolean>;
|
|
62
|
-
/**
|
|
63
|
-
* Forces Clarity to start a new session asynchronously.
|
|
64
|
-
*
|
|
65
|
-
* @param callback - A callback that is invoked when the new session starts. The callback receives the new session ID as a string parameter.
|
|
66
|
-
*
|
|
67
|
-
* **Notes:**
|
|
68
|
-
* - This function is asynchronous, meaning it returns before the new session is started.
|
|
69
|
-
* - Use the {@linkcode callback} parameter to execute logic that needs to run after the new session begins.
|
|
70
|
-
* - Events that occur before invoking the callback are associated with the previous session.
|
|
71
|
-
* - To ensure proper association of custom tags, user ID, or session ID with the new session, set them within the callback.
|
|
72
|
-
*/
|
|
73
|
-
export declare function startNewSession(callback: (sessionId: String) => void): void;
|
|
74
|
-
/**
|
|
75
|
-
* Sets a custom user ID for the current session. This ID can be used to filter sessions on the Clarity dashboard.
|
|
76
|
-
*
|
|
77
|
-
* @param customUserId - The custom user ID to associate with the current session. The value must be a nonempty string, with a maximum length of 255 characters, and can't consist only of whitespace.
|
|
78
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if the custom user ID was set successfully; otherwise `false`.
|
|
79
|
-
*
|
|
80
|
-
* **Notes:**
|
|
81
|
-
* - To ensure that the custom user ID is associated with the correct session, it's recommended to call this function within the callbacks of {@linkcode setOnSessionStartedCallback} or {@linkcode startNewSession}.
|
|
82
|
-
* - Unlike the `userID`, the {@linkcode customUserId} value has fewer restrictions.
|
|
83
|
-
* - We recommend **not** to set any Personally Identifiable Information (PII) values inside this field.
|
|
84
|
-
*/
|
|
85
|
-
export declare function setCustomUserId(customUserId: string): Promise<boolean>;
|
|
86
|
-
/**
|
|
87
|
-
* Sets a custom session ID for the current session. This ID can be used to filter sessions on the Clarity dashboard.
|
|
88
|
-
*
|
|
89
|
-
* @param customSessionId - The custom session ID to associate with the current session. The value must be a nonempty string, with a maximum length of 255 characters, and can't consist only of whitespace.
|
|
90
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if the custom session ID was set successfully; otherwise `false`.
|
|
91
|
-
*
|
|
92
|
-
* **Notes:**
|
|
93
|
-
* - To ensure that the custom session ID is associated with the correct session, it's recommended to call this function within the callbacks of {@linkcode setOnSessionStartedCallback} or {@linkcode startNewSession}.
|
|
94
|
-
*/
|
|
95
|
-
export declare function setCustomSessionId(customSessionId: string): Promise<boolean>;
|
|
96
|
-
/**
|
|
97
|
-
* Sets a custom tag for the current session. This tag can be used to filter sessions on the Clarity dashboard.
|
|
98
|
-
*
|
|
99
|
-
* @param key - The key for the custom tag. The value must be a nonempty string, with a maximum length of 255 characters, and can't consist only of whitespace.
|
|
100
|
-
* @param value - The value for the custom tag. The value must be a nonempty string, with a maximum length of 255 characters, and can't consist only of whitespace.
|
|
101
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if the custom tag was set successfully; otherwise `false`.
|
|
102
|
-
*
|
|
103
|
-
* **Notes:**
|
|
104
|
-
* - To ensure that the custom tag is associated with the correct session, it's recommended to call this function within the callbacks of {@linkcode setOnSessionStartedCallback} or {@linkcode startNewSession}.
|
|
105
|
-
*/
|
|
106
|
-
export declare function setCustomTag(key: string, value: string): Promise<boolean>;
|
|
107
|
-
/**
|
|
108
|
-
* Sets custom tags for the current session. These tags can be used to filter sessions on the Clarity dashboard.
|
|
109
|
-
*
|
|
110
|
-
* @param key - The key for the custom tag. The value must be a nonempty string, with a maximum length of 255 characters, and can't consist only of whitespace.
|
|
111
|
-
* @param values - The values for the custom tag. Each value must be a nonempty string, with a maximum length of 255 characters, and can't consist only of whitespace.
|
|
112
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if the custom tag was set successfully; otherwise `false`.
|
|
113
|
-
*
|
|
114
|
-
* **Notes:**
|
|
115
|
-
* - To ensure that the custom tag is associated with the correct session, it's recommended to call this function within the callbacks of {@linkcode setOnSessionStartedCallback} or {@linkcode startNewSession}.
|
|
116
|
-
*/
|
|
117
|
-
export declare function setCustomTags(key: string, values: string[]): Promise<boolean>;
|
|
118
|
-
/**
|
|
119
|
-
* Sends a custom event to the current Clarity session. These custom events can be used to track specific user interactions or actions that Clarity's built-in event tracking doesn't capture.
|
|
120
|
-
*
|
|
121
|
-
* @param value - The name of the custom event. The value must be a nonempty string, with a maximum length of 254 characters, and can't consist only of whitespace.
|
|
122
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if the custom event was sent successfully; otherwise `false`.
|
|
123
|
-
*
|
|
124
|
-
* **Notes:**
|
|
125
|
-
* - This API can be called multiple times per page to track various user actions.
|
|
126
|
-
* - Each custom event is logged individually and can be filtered, viewed, and analyzed on the Clarity dashboard.
|
|
127
|
-
*/
|
|
128
|
-
export declare function sendCustomEvent(value: string): Promise<boolean>;
|
|
129
|
-
/**
|
|
130
|
-
* Sets a callback function that's invoked whenever a new Clarity session starts or an existing session is resumed at app startup.
|
|
131
|
-
*
|
|
132
|
-
* @param callback - The callback to be invoked whenever a Clarity session starts. The callback receives the new or resumed session ID as a string parameter.
|
|
133
|
-
* @returns {boolean} `true` if the callback was set successfully; otherwise `false`.
|
|
134
|
-
*
|
|
135
|
-
* **Notes:**
|
|
136
|
-
* - If the callback is set after a session has already started, the callback is invoked right away with the current session ID.
|
|
137
|
-
* - The specified callback is guaranteed to run on the main thread.
|
|
138
|
-
*/
|
|
139
|
-
export declare function setOnSessionStartedCallback(callback: (sessionId: String) => void): boolean;
|
|
140
|
-
/**
|
|
141
|
-
* This function allows you to provide a custom screen name that replaces the default screen name. The default name is automatically generated based on the current activity in Android, or the currently presented view controller's title or type in iOS.
|
|
142
|
-
*
|
|
143
|
-
* @param screenName - The desired screen name. The value must be a nonempty string, with a maximum length of 255 characters, and can't consist only of whitespace. Set to `null` to reset.
|
|
144
|
-
*
|
|
145
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if the specified screen name was set successfully; otherwise `false`.
|
|
146
|
-
*
|
|
147
|
-
* **Example:**
|
|
148
|
-
* - If the presented iOS view controller is a `UIViewController`, and `setCurrentScreenName("Settings")` is called, the screen name is tracked as "Settings".
|
|
149
|
-
* - If `setCurrentScreenName(null)` is called on the same view controller, the screen name is tracked as "UIViewController".
|
|
150
|
-
*
|
|
151
|
-
* **Notes:**
|
|
152
|
-
* - Clarity starts a new page whenever the screen name changes.
|
|
153
|
-
* - To mask or disallow a screen, specify the view controller's type that is displayed as "ViewController" custom tag of the page visit on the Clarity dashboard's recordings. For example, to mask the iOS view controller in the previous example, mask the "&TabBarController" screen instead of "&Settings".
|
|
154
|
-
* - The custom screen name is set globally and persists across all subsequent view controllers until explicitly reset.
|
|
155
|
-
*/
|
|
156
|
-
export declare function setCurrentScreenName(screenName: string | null): Promise<boolean>;
|
|
157
|
-
/**
|
|
158
|
-
* @deprecated This function is deprecated and would be removed in a future major version. Use {@linkcode getCurrentSessionUrl} instead.
|
|
159
|
-
*
|
|
160
|
-
* Returns the ID of the currently active Clarity session if a session has already started; otherwise `undefined`.
|
|
161
|
-
*
|
|
162
|
-
* @returns {Promise<string | undefined>} A Promise that resolves with a string representing the ID of the currently active Clarity session if a session has already started; otherwise `undefined`.
|
|
163
|
-
*
|
|
164
|
-
* **Note:**
|
|
165
|
-
* - The session ID can be used to correlate Clarity sessions with other telemetry services.
|
|
166
|
-
* - Initially, this function might return `undefined` until a Clarity session begins.
|
|
167
|
-
* - To ensure a valid session ID, use this method within the callbacks of {@linkcode setOnSessionStartedCallback} or {@linkcode startNewSession}.
|
|
168
|
-
*/
|
|
169
|
-
export declare function getCurrentSessionId(): Promise<string | undefined>;
|
|
170
|
-
/**
|
|
171
|
-
* Returns the URL of the current Clarity session recording on the Clarity dashboard if a session has already started; otherwise `undefined`.
|
|
172
|
-
*
|
|
173
|
-
* @returns {Promise<string | undefined>} A Promise that resolves with a string representing the URL of the current Clarity session recording on the Clarity dashboard if a session has already started; otherwise `undefined`.
|
|
174
|
-
*
|
|
175
|
-
* **Notes:**
|
|
176
|
-
* - Initially, this function might return `undefined` until a Clarity session begins.
|
|
177
|
-
* - To ensure a valid session URL, use this method within the callbacks of {@linkcode setOnSessionStartedCallback} or {@linkcode startNewSession}.
|
|
178
|
-
*/
|
|
179
|
-
export declare function getCurrentSessionUrl(): Promise<string | undefined>;
|
|
180
|
-
/**
|
|
181
|
-
* Sets the user's consent status for data collection, which adjusts the SDK's behavior based on the user's choices.
|
|
182
|
-
*
|
|
183
|
-
* @param adsStorage - The user's consent status for ads data collection.
|
|
184
|
-
* @param analyticsStorage - The user's consent status for analytics data collection.
|
|
185
|
-
* @returns {Promise<boolean>} A Promise that resolves with `true` if the consent status was set successfully; otherwise `false`.
|
|
186
|
-
*
|
|
187
|
-
* **Notes:**
|
|
188
|
-
* - You are responsible for obtaining the user's consent (for example, via a consent banner or another custom solution).
|
|
189
|
-
* - Available on Android only. On iOS the function logs a warning and resolves with `false`.
|
|
190
|
-
*/
|
|
191
|
-
export declare function consent(adsStorage: boolean, analyticsStorage: boolean): Promise<boolean>;
|
|
192
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AA0BA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAiBD;;GAEG;AACH,oBAAY,QAAQ;IAClB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,IAAI,SAAS;CACd;AA2ED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,aAAa,QAiBnE;AAED;;;;GAIG;AACH,wBAAgB,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC,CAMxC;AAED;;;;GAIG;AACH,wBAAgB,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,CAMzC;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC,CAM3C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAM3E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAMtE;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAM5E;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAA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