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

react-hotjar

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-hotjar - npm Package Compare versions

Comparing version 3.0.1 to 4.0.0

16

index.d.ts

@@ -18,2 +18,18 @@ export module hotjar {

): void;
/**
* Add an event to the current session
* @param event Event to add to the session
*/
export function event(
event: string
): void;
/**
* Update the state of the SPA
* @param relativePath Current page URL (such as `product/red-trainer`)
*/
export function stateChange(
relativePath: string,
): void;
}

16

index.js
var hotjar = require('./src/react-hotjar');
function hj(...params) {
if (!window.hj) {
throw new Error('Hotjar is not initialized');
}
window.hj(...params);
}
module.exports = {

@@ -9,5 +17,11 @@ hotjar: {

identify: function identify(userId, properties) {
hotjar('identify', userId, properties);
hj('identify', userId, properties);
},
event: function event(event) {
hj('event', event);
},
stateChange: function stateChange(relativePath) {
hj('stateChange', relativePath);
}
}
};

2

package.json
{
"name": "react-hotjar",
"version": "3.0.1",
"version": "4.0.0",
"description": "Small component to implement Hotjar into your react application",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -14,4 +14,11 @@ # react-hotjar

hotjar.initialize(hjid, hjsv);
<!-- Optional identify call -->
// Identify the user
hotjar.identify('USER_ID', { userProperty: 'value' });
// Add an event
hotjar.event('button-click');
// Update SPA state
hotjar.stateChange('/my/page');
```

@@ -18,0 +25,0 @@ - hjid: Stands for 'Hotjar ID' - Your site's ID. This is the ID which tells Hotjar which site settings it should load and where it should save the data collected.

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