@useblu/blu-lytics
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -7,3 +7,3 @@ /* eslint-disable import/no-mutable-exports */ | ||
import { CaptureConsole } from '@sentry/integrations'; | ||
import { clarity } from 'react-microsoft-clarity'; | ||
import { clarity } from 'clarity-js'; | ||
/** | ||
@@ -22,4 +22,9 @@ * Checks if the environment is set to 'production'. | ||
var clarityInitializer = function (environment, apiKey) { | ||
if (isProduction(environment)) | ||
clarity.init(apiKey); | ||
if (isProduction(environment)) { | ||
clarity.start({ | ||
projectId: apiKey, | ||
track: true, | ||
content: true | ||
}); | ||
} | ||
}; | ||
@@ -26,0 +31,0 @@ /** |
@@ -1,10 +0,10 @@ | ||
import { clarity } from 'react-microsoft-clarity'; | ||
import { clarity } from 'clarity-js'; | ||
var dispatchUserIdentification = function (id, userProperties) { | ||
clarity.identify(id, { userProperties: 'id' }); | ||
clarity.identify(id); | ||
}; | ||
var dispatchCustomEvent = function (event, properties) { | ||
clarity.setTag(event, 'customEvent'); | ||
clarity.set(event, 'customEvent'); | ||
}; | ||
var dispatchScreenEvent = function (screen) { | ||
clarity.setTag(screen, 'screen'); | ||
clarity.set(screen, 'screen'); | ||
}; | ||
@@ -11,0 +11,0 @@ var ClarityProvider = { |
@@ -1,7 +0,7 @@ | ||
import { clarity } from 'react-microsoft-clarity'; | ||
import { clarity } from 'clarity-js'; | ||
import ClarityProvider from './clarity'; | ||
jest.mock('react-microsoft-clarity', function () { return ({ | ||
jest.mock('clarity-js', function () { return ({ | ||
clarity: { | ||
identify: jest.fn(), | ||
setTag: jest.fn() | ||
set: jest.fn() | ||
} | ||
@@ -12,16 +12,16 @@ }); }); | ||
var userId = 'user123'; | ||
ClarityProvider.userIdentification(userId, { userProperties: 'id' }); | ||
expect(clarity.identify).toHaveBeenCalledWith(userId, { userProperties: 'id' }); | ||
ClarityProvider.userIdentification(userId, ''); | ||
expect(clarity.identify).toHaveBeenCalledWith(userId); | ||
}); | ||
it('dispatchCustomEvent should call clarity.setTag with correct arguments', function () { | ||
it('dispatchCustomEvent should call clarity.set with correct arguments', function () { | ||
var eventName = 'clickEvent'; | ||
var properties = { key: 'value' }; | ||
ClarityProvider.customEvent(eventName, properties); | ||
expect(clarity.setTag).toHaveBeenCalledWith(eventName, 'customEvent'); | ||
expect(clarity.set).toHaveBeenCalledWith(eventName, 'customEvent'); | ||
}); | ||
it('dispatchScreenEvent should call clarity.setTag with correct arguments', function () { | ||
it('dispatchScreenEvent should call clarity.set with correct arguments', function () { | ||
var screenName = 'HomeScreen'; | ||
ClarityProvider.screenEvent(screenName); | ||
expect(clarity.setTag).toHaveBeenCalledWith(screenName, 'screen'); | ||
expect(clarity.set).toHaveBeenCalledWith(screenName, 'screen'); | ||
}); | ||
}); |
{ | ||
"name": "@useblu/blu-lytics", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"private": false, | ||
@@ -23,6 +23,6 @@ "license": "MIT", | ||
"@sentry/tracing": "^6.19.7", | ||
"clarity-js": "^0.7.24", | ||
"jest-environment-jsdom": "^29.7.0", | ||
"mixpanel-browser": "^2.48.1", | ||
"react": "^18.2.0", | ||
"react-microsoft-clarity": "^1.2.0" | ||
"react": "^18.2.0" | ||
}, | ||
@@ -29,0 +29,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
723
41773
+ Addedclarity-js@^0.7.24
+ Addedclarity-js@0.7.62(transitive)
- Removedreact-microsoft-clarity@^1.2.0
- Removedreact-microsoft-clarity@1.2.0(transitive)