@deriv-com/analytics 1.5.5 → 1.5.7
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/analytics.js +5 -4
- package/lib/types.d.ts +1 -1
- package/package.json +1 -1
package/lib/analytics.js
CHANGED
@@ -50,13 +50,13 @@ function createAnalyticsInstance(options) {
|
|
50
50
|
domain: domain,
|
51
51
|
});
|
52
52
|
}
|
53
|
-
core_data = __assign(__assign(__assign(__assign(__assign(__assign(
|
53
|
+
core_data = __assign(__assign(__assign(__assign(__assign(__assign({}, core_data), (user_language !== undefined && { user_language: user_language })), (account_type !== undefined && { account_type: account_type })), (app_id !== undefined && { app_id: app_id })), (device_type !== undefined && { device_type: device_type })), (url !== undefined && { url: url }));
|
54
54
|
};
|
55
55
|
var getFeatureState = function (id) { var _a, _b; return (_b = (_a = _growthbook === null || _growthbook === void 0 ? void 0 : _growthbook.getFeatureState(id)) === null || _a === void 0 ? void 0 : _a.experimentResult) === null || _b === void 0 ? void 0 : _b.name; };
|
56
56
|
var getFeatureValue = function (id, defaultValue) { return _growthbook === null || _growthbook === void 0 ? void 0 : _growthbook.getFeatureValue(id, defaultValue); };
|
57
57
|
var isFeatureOn = function (key) { return _growthbook === null || _growthbook === void 0 ? void 0 : _growthbook.isOn(key); };
|
58
58
|
var setUrl = function (href) { return _growthbook === null || _growthbook === void 0 ? void 0 : _growthbook.setUrl(href); };
|
59
|
-
var getId = function () { return
|
59
|
+
var getId = function () { return _rudderstack === null || _rudderstack === void 0 ? void 0 : _rudderstack.getUserId(); };
|
60
60
|
/**
|
61
61
|
* Pushes page view event to Rudderstack
|
62
62
|
*
|
@@ -69,8 +69,9 @@ function createAnalyticsInstance(options) {
|
|
69
69
|
_rudderstack === null || _rudderstack === void 0 ? void 0 : _rudderstack.pageView(current_page, platform, getId());
|
70
70
|
};
|
71
71
|
var identifyEvent = function () {
|
72
|
-
|
73
|
-
|
72
|
+
var user_identity = getId();
|
73
|
+
if (user_identity && _rudderstack) {
|
74
|
+
_rudderstack === null || _rudderstack === void 0 ? void 0 : _rudderstack.identifyEvent(user_identity, { language: (core_data === null || core_data === void 0 ? void 0 : core_data.user_language) || 'en' });
|
74
75
|
}
|
75
76
|
};
|
76
77
|
var reset = function () {
|
package/lib/types.d.ts
CHANGED
@@ -237,7 +237,7 @@ type PassKeyEffortlessFormAction = {
|
|
237
237
|
};
|
238
238
|
type PassKeyAccountSettingsFormAction = {
|
239
239
|
action?: 'open' | 'close' | 'info_open' | 'info_back' | 'create_passkey_started' | 'create_passkey_reminder_passed' | 'create_passkey_finished' | 'create_passkey_continue_trading' | 'error' | 'add_more_passkeys';
|
240
|
-
|
240
|
+
form_name?: string;
|
241
241
|
subform_name?: string;
|
242
242
|
remove_verification_provider?: string;
|
243
243
|
error_message?: string;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@deriv-com/analytics",
|
3
|
-
"version": "1.5.
|
3
|
+
"version": "1.5.7",
|
4
4
|
"description": "The analytics package contains all the utility functions used for tracking user events and sending them to the respective platform such as Rudderstack.",
|
5
5
|
"keywords": [
|
6
6
|
"rudderstack",
|