Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@useblu/blu-lytics

Package Overview
Dependencies
Maintainers
6
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@useblu/blu-lytics - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

11

lib/initializers/index.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc