react-hotjar
Advanced tools
Comparing version 5.0.0 to 5.1.0
@@ -10,2 +10,7 @@ export module hotjar { | ||
/** | ||
* Check if Hotjar has been initialized | ||
*/ | ||
export function initialized(): boolean; | ||
/** | ||
* Identify user | ||
@@ -12,0 +17,0 @@ * @param userId Unique ID of a user |
@@ -9,3 +9,3 @@ var hotjar = require('./src/react-hotjar'); | ||
window.hj.apply(undefined, params) | ||
window.hj.apply(undefined, params); | ||
} | ||
@@ -18,2 +18,5 @@ | ||
}, | ||
initialized: function initialized() { | ||
return typeof window.hj === 'function'; | ||
}, | ||
identify: function identify(userId, properties) { | ||
@@ -20,0 +23,0 @@ hj('identify', userId, properties); |
{ | ||
"name": "react-hotjar", | ||
"version": "5.0.0", | ||
"version": "5.1.0", | ||
"description": "Small component to implement Hotjar into your react application", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -23,2 +23,7 @@ # react-hotjar | ||
hotjar.stateChange('/my/page'); | ||
// Check if Hotjar has been initialized before calling its methods | ||
if (hotjar.initialized()) { | ||
hotjar.identify('USER_ID', { userProperty: 'value' }); | ||
} | ||
``` | ||
@@ -25,0 +30,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. |
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
5223
82
34