react-hotjar
Advanced tools
Comparing version 5.5.0 to 6.0.0
41
index.js
@@ -1,30 +0,27 @@ | ||
var hotjar = require('./src/react-hotjar'); | ||
import hotjar from './src/react-hotjar'; | ||
function hj() { | ||
var params = Array.prototype.slice.call(arguments); | ||
const params = Array.prototype.slice.call(arguments); | ||
if (!window.hj) { | ||
throw new Error('Hotjar is not initialized'); | ||
} | ||
window.hj.apply(undefined, params); | ||
} | ||
module.exports = { | ||
hotjar: { | ||
initialize: function initialize(id, sv) { | ||
hotjar(id, sv); | ||
}, | ||
initialized: function initialized() { | ||
return typeof window !== 'undefined' && typeof window?.hj === 'function'; | ||
}, | ||
identify: function identify(userId, properties) { | ||
hj('identify', userId, properties); | ||
}, | ||
event: function event(event) { | ||
hj('event', event); | ||
}, | ||
stateChange: function stateChange(relativePath) { | ||
hj('stateChange', relativePath); | ||
} | ||
} | ||
}; | ||
export const hotjar = { | ||
initialize: function initialize(id, sv) { | ||
hotjar(id, sv); | ||
}, | ||
initialized: function initialized() { | ||
return typeof window !== 'undefined' && typeof window.hj === 'function'; | ||
}, | ||
identify: function identify(userId, properties) { | ||
hj('identify', userId, properties); | ||
}, | ||
event: function event(event) { | ||
hj('event', event); | ||
}, | ||
stateChange: function stateChange(relativePath) { | ||
hj('stateChange', relativePath); | ||
}, | ||
}; |
{ | ||
"name": "react-hotjar", | ||
"version": "5.5.0", | ||
"version": "6.0.0", | ||
"description": "Small component to implement Hotjar into your react application", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
5362
80