@useblu/blu-lytics 1.0.6 → 1.0.8
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 +5 -5
- package/lib/initializers/index.d.ts.map +1 -1
- package/lib/initializers/index.js +1 -0
- package/lib/providers/setups/clarity/clarity.d.ts.map +1 -1
- package/lib/providers/setups/clarity/clarity.js +1 -2
- package/lib/providers/setups/clarity/clarity.spec.js +2 -12
- package/lib/providers/setups/mixpanel/mixpanel.d.ts.map +1 -1
- package/lib/providers/setups/mixpanel/mixpanel.js +1 -0
- package/package.json +3 -6
package/README.md
CHANGED
|
@@ -31,13 +31,13 @@ npm i @useblu/blu-lytics
|
|
|
31
31
|
#### Destructuring the import
|
|
32
32
|
```js
|
|
33
33
|
|
|
34
|
-
import { initializeProviders } from
|
|
34
|
+
import { initializeProviders } from 'blu-lytics';
|
|
35
35
|
|
|
36
36
|
```
|
|
37
37
|
#### Importing all functionalities
|
|
38
38
|
```js
|
|
39
39
|
|
|
40
|
-
import * as blu-lytics from
|
|
40
|
+
import * as blu-lytics from 'blu-lytics';
|
|
41
41
|
|
|
42
42
|
```
|
|
43
43
|
|
|
@@ -46,7 +46,7 @@ This method simplifies the connection to one or more monitoring tools, eliminati
|
|
|
46
46
|
|
|
47
47
|
To establish a connection with a single tool, it is necessary to pass an object as a parameter, containing the fields providerName, apiKey, and another object with the environment (the latter is optional, with the default value being 'production').
|
|
48
48
|
```js
|
|
49
|
-
initializeProviders({providerName: 'track-tool-name', apiKey: 'your-api-key'}, {environment:
|
|
49
|
+
initializeProviders({providerName: 'track-tool-name', apiKey: 'your-api-key'}, {environment: 'development'});
|
|
50
50
|
```
|
|
51
51
|
|
|
52
52
|
To connect to more than one tool, it is necessary to pass an array (list) of objects as a parameter, maintaining the fields providerName, apiKey, and another object containing environment (optional).
|
|
@@ -54,13 +54,13 @@ To connect to more than one tool, it is necessary to pass an array (list) of obj
|
|
|
54
54
|
initializeProviders([
|
|
55
55
|
{ providerName: 'track-tool-name', apiKey: 'your-api-key'},
|
|
56
56
|
{ providerName: 'another-track-tool-name', apiKey: 'your-api-key'}
|
|
57
|
-
], {environment:
|
|
57
|
+
], {environment: 'development'});
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
### Method: `sendScreenEvent`
|
|
61
61
|
This method sends a message that will be propagated and recorded in all tools that have been previously initialized through the initializeProviders method. To use it, only a string needs to be provided as a parameter.
|
|
62
62
|
```js
|
|
63
|
-
sendScreenEvent(
|
|
63
|
+
sendScreenEvent('page_view');
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
### Method: `sendCustomEvent`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/initializers/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/initializers/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AA0G1E;;;;;;;GAOG;AACH,QAAA,IAAI,uBAAuB,EAAE,eAAe,CAAC;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,gBACjB,iBAAiB,GAAG,iBAAiB,EAAE;iBAC5B,eAAe;MACtC,IAsCF,CAAC;AAEF,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clarity.d.ts","sourceRoot":"","sources":["../../../../src/providers/setups/clarity/clarity.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"clarity.d.ts","sourceRoot":"","sources":["../../../../src/providers/setups/clarity/clarity.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAyBpD,QAAA,MAAM,eAAe,EAAE,YAKtB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { clarity } from 'clarity-js';
|
|
2
2
|
var dispatchUserIdentification = function (id, userProperties) {
|
|
3
|
+
clarity.consent();
|
|
3
4
|
clarity.identify(id);
|
|
4
5
|
};
|
|
5
6
|
var dispatchCustomEvent = function (event, properties) {
|
|
6
|
-
clarity.set(event, 'customEvent');
|
|
7
7
|
};
|
|
8
8
|
var dispatchScreenEvent = function (screen) {
|
|
9
|
-
clarity.set(screen, 'screen');
|
|
10
9
|
};
|
|
11
10
|
var ClarityProvider = {
|
|
12
11
|
name: 'Clarity',
|
|
@@ -3,7 +3,8 @@ import ClarityProvider from './clarity';
|
|
|
3
3
|
jest.mock('clarity-js', function () { return ({
|
|
4
4
|
clarity: {
|
|
5
5
|
identify: jest.fn(),
|
|
6
|
-
set: jest.fn()
|
|
6
|
+
set: jest.fn(),
|
|
7
|
+
consent: jest.fn()
|
|
7
8
|
}
|
|
8
9
|
}); });
|
|
9
10
|
describe('ClarityProvider', function () {
|
|
@@ -12,15 +13,4 @@ describe('ClarityProvider', function () {
|
|
|
12
13
|
ClarityProvider.userIdentification(userId, '');
|
|
13
14
|
expect(clarity.identify).toHaveBeenCalledWith(userId);
|
|
14
15
|
});
|
|
15
|
-
it('dispatchCustomEvent should call clarity.set with correct arguments', function () {
|
|
16
|
-
var eventName = 'clickEvent';
|
|
17
|
-
var properties = { key: 'value' };
|
|
18
|
-
ClarityProvider.customEvent(eventName, properties);
|
|
19
|
-
expect(clarity.set).toHaveBeenCalledWith(eventName, 'customEvent');
|
|
20
|
-
});
|
|
21
|
-
it('dispatchScreenEvent should call clarity.set with correct arguments', function () {
|
|
22
|
-
var screenName = 'HomeScreen';
|
|
23
|
-
ClarityProvider.screenEvent(screenName);
|
|
24
|
-
expect(clarity.set).toHaveBeenCalledWith(screenName, 'screen');
|
|
25
|
-
});
|
|
26
16
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mixpanel.d.ts","sourceRoot":"","sources":["../../../../src/providers/setups/mixpanel/mixpanel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"mixpanel.d.ts","sourceRoot":"","sources":["../../../../src/providers/setups/mixpanel/mixpanel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AA6CpD,QAAA,MAAM,gBAAgB,EAAE,YAKvB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -12,6 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import mixpanel from 'mixpanel-browser';
|
|
13
13
|
var dispatchUserIdentification = function (id, userProperties) {
|
|
14
14
|
mixpanel.identify(id);
|
|
15
|
+
mixpanel.people.set({ USER_ID: id });
|
|
15
16
|
var superProperties = ['name', 'email'];
|
|
16
17
|
var peopleProperties = {};
|
|
17
18
|
var cipherProperty = function (key) {
|
package/package.json
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useblu/blu-lytics",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
8
|
-
"engines": {
|
|
9
|
-
"node": "^16.10.0"
|
|
10
|
-
},
|
|
11
8
|
"scripts": {
|
|
12
9
|
"build": "tsc --declaration",
|
|
13
10
|
"dev": "ts-node src/index.ts",
|
|
@@ -20,9 +17,9 @@
|
|
|
20
17
|
"@sentry/integrations": "^6.19.7",
|
|
21
18
|
"@sentry/react": "^6.19.7",
|
|
22
19
|
"@sentry/tracing": "^6.19.7",
|
|
23
|
-
"clarity-js": "^0.7.
|
|
20
|
+
"clarity-js": "^0.7.32",
|
|
24
21
|
"jest-environment-jsdom": "^29.7.0",
|
|
25
|
-
"mixpanel-browser": "^2.
|
|
22
|
+
"mixpanel-browser": "^2.49.0",
|
|
26
23
|
"react": "^18.2.0"
|
|
27
24
|
},
|
|
28
25
|
"devDependencies": {
|