@hotjar/browser
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -5,2 +5,4 @@ # Changelog | ||
### 1.0.4 (2021-12-08) | ||
### 1.0.3 (2021-05-14) | ||
@@ -7,0 +9,0 @@ |
declare type UserInfo = Record<string | number, string | number | Date | boolean>; | ||
declare const Hotjar: { | ||
init: (hotjarId: number, hotjarVersion: number) => boolean; | ||
event: (actionName: string) => boolean; | ||
identify: (userId: string | null, userInfo: UserInfo) => boolean; | ||
@@ -5,0 +6,0 @@ stateChange: (relativePath: string) => boolean; |
@@ -1,2 +0,2 @@ | ||
const t=()=>"undefined"!=typeof window,r=()=>!(!t()||!window.hj),e=(r,...e)=>{if(t()&&window.hj)return window.hj(r,...e);throw Error("Hotjar is not available, make sure init has been called.")},n=(t,e)=>{if(!((t,r)=>{try{const e=document.getElementById(r)||document.createElement("script");return e.id=r,e.innerText=t,e.crossOrigin="anonymous",document.head.appendChild(e),!0}catch(t){return!1}})(`(function(h,o,t,j,a,r){h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};h._hjSettings={hjid:${t},hjsv:${e}};a=o.getElementsByTagName('head')[0];r=o.createElement('script');r.async=1;r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;a.appendChild(r);})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');`,"hotjar-init-script")||!r())throw Error("Failed to initialize Hotjar tracking script.")},i={init:(t,r)=>{try{return n(t,r),!0}catch(t){return console.error("Error:",t),!1}},identify:(t,r)=>{try{return e("identify",t,r),!0}catch(t){return console.error("Error:",t),!1}},stateChange:t=>{try{return e("stateChange",t),!0}catch(t){return console.error("Error:",t),!1}},isReady:r};export default i; | ||
const r=()=>"undefined"!=typeof window,t=()=>!(!r()||!window.hj),e=(t,...e)=>{if(r()&&window.hj)return window.hj(t,...e);throw Error("Hotjar is not available, make sure init has been called.")},n=(r,e)=>{if(!((r,t)=>{try{const e=document.getElementById(t)||document.createElement("script");return e.id=t,e.innerText=r,e.crossOrigin="anonymous",document.head.appendChild(e),!0}catch(r){return!1}})(`(function(h,o,t,j,a,r){h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};h._hjSettings={hjid:${r},hjsv:${e}};a=o.getElementsByTagName('head')[0];r=o.createElement('script');r.async=1;r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;a.appendChild(r);})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');`,"hotjar-init-script")||!t())throw Error("Failed to initialize Hotjar tracking script.")},o={init:(r,t)=>{try{return n(r,t),!0}catch(r){return console.error("Error:",r),!1}},event:r=>{try{return e("event",r),!0}catch(r){return console.error("Error:",r),!1}},identify:(r,t)=>{try{return e("identify",r,t),!0}catch(r){return console.error("Error:",r),!1}},stateChange:r=>{try{return e("stateChange",r),!0}catch(r){return console.error("Error:",r),!1}},isReady:t};export default o; | ||
//# sourceMappingURL=index.esm.js.map |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const t=()=>"undefined"!=typeof window,r=()=>!(!t()||!window.hj),e=(r,...e)=>{if(t()&&window.hj)return window.hj(r,...e);throw Error("Hotjar is not available, make sure init has been called.")},n=(t,e)=>{if(!((t,r)=>{try{const e=document.getElementById(r)||document.createElement("script");return e.id=r,e.innerText=t,e.crossOrigin="anonymous",document.head.appendChild(e),!0}catch(t){return!1}})(`(function(h,o,t,j,a,r){h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};h._hjSettings={hjid:${t},hjsv:${e}};a=o.getElementsByTagName('head')[0];r=o.createElement('script');r.async=1;r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;a.appendChild(r);})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');`,"hotjar-init-script")||!r())throw Error("Failed to initialize Hotjar tracking script.")},o={init:(t,r)=>{try{return n(t,r),!0}catch(t){return console.error("Error:",t),!1}},identify:(t,r)=>{try{return e("identify",t,r),!0}catch(t){return console.error("Error:",t),!1}},stateChange:t=>{try{return e("stateChange",t),!0}catch(t){return console.error("Error:",t),!1}},isReady:r};exports.default=o; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const r=()=>"undefined"!=typeof window,t=()=>!(!r()||!window.hj),e=(t,...e)=>{if(r()&&window.hj)return window.hj(t,...e);throw Error("Hotjar is not available, make sure init has been called.")},n=(r,e)=>{if(!((r,t)=>{try{const e=document.getElementById(t)||document.createElement("script");return e.id=t,e.innerText=r,e.crossOrigin="anonymous",document.head.appendChild(e),!0}catch(r){return!1}})(`(function(h,o,t,j,a,r){h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};h._hjSettings={hjid:${r},hjsv:${e}};a=o.getElementsByTagName('head')[0];r=o.createElement('script');r.async=1;r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;a.appendChild(r);})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');`,"hotjar-init-script")||!t())throw Error("Failed to initialize Hotjar tracking script.")},o={init:(r,t)=>{try{return n(r,t),!0}catch(r){return console.error("Error:",r),!1}},event:r=>{try{return e("event",r),!0}catch(r){return console.error("Error:",r),!1}},identify:(r,t)=>{try{return e("identify",r,t),!0}catch(r){return console.error("Error:",r),!1}},stateChange:r=>{try{return e("stateChange",r),!0}catch(r){return console.error("Error:",r),!1}},isReady:t};exports.default=o; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
declare type HotjarCommand = 'identify' | 'stateChange'; | ||
declare type HotjarCommand = 'event' | 'identify' | 'stateChange'; | ||
export interface WindowWithHotjar extends Window { | ||
@@ -3,0 +3,0 @@ hj?: (method: HotjarCommand, ...data: unknown[]) => void; |
{ | ||
"name": "@hotjar/browser", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Bring Hotjar directly to your application", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -44,2 +44,11 @@ # @hotjar/browser | ||
## Events API | ||
You can also track specific actions taken by your users and send that data to Hotjar via the [Hotjar Events API]("https://help.hotjar.com/hc/en-us/articles/4405109971095-Events-API-Reference"). | ||
```javascript | ||
const actionName = 'error'; | ||
Hotjar.event(actionName); | ||
``` | ||
## Manual URL changes | ||
@@ -46,0 +55,0 @@ |
Sorry, the diff of this file is not supported yet
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
11716
29
66