vue-hotjar
Advanced tools
Comparing version 1.2.0 to 1.3.0
/* eslint-disable no-unused-vars */ | ||
import { PluginObject } from 'vue' | ||
import { PluginFunction, PluginObject } from 'vue' | ||
export interface VueHotjarPlugin extends PluginObject<VueHotjarUseOptions> {} | ||
export interface VueHotjarPlugin extends PluginObject<VueHotjarUseOptions> { | ||
install: PluginFunction<VueHotjarUseOptions> | ||
} | ||
export interface VueHotjarUseOptions { | ||
@@ -6,0 +9,0 @@ /** |
@@ -1,1 +0,1 @@ | ||
!function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t=n();for(var r in t)("object"==typeof exports?exports:e)[r]=t[r]}}("undefined"!=typeof self?self:this,(function(){return function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=0)}([function(e,n,t){"use strict";t.r(n);var r=function e(n,t){var r,o,i,u;!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),r=window,o=document,r.hj=r.hj||function(){(r.hj.q=r.hj.q||[]).push(arguments)},r._hjSettings={hjid:n,hjsv:t},i=o.getElementsByTagName("head")[0],(u=o.createElement("script")).async=1,u.src="https://static.hotjar.com/c/hotjar-"+r._hjSettings.hjid+".js?sv="+r._hjSettings.hjsv,i.appendChild(u)};function o(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var i=function(){function e(){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e)}var n,t,r;return n=e,r=[{key:"options",value:function(e){if(function(){var n=new RegExp(/^([0-9])*\d$/g);if(e.id){if(!1===n.test(e.id))throw new Error("Invalid Hotjar Tracking ID");if("string"!=typeof e.id)throw new Error("Hotjar Tracking ID expects a string");return!0}throw new Error("Hotjar Tracking ID is not defined")}()&&function(){if("boolean"!=typeof e.isProduction&&e.isProduction)throw new Error("isProduction expects a boolean");return!0}()&&function(){if("number"!=typeof e.snippetVersion&&e.snippetVersion)throw new Error("snippetVersion expects a number");return!0}())return!0}}],(t=null)&&o(n.prototype,t),r&&o(n,r),e}();n.default={install:function(e,n){e.prototype.$hj=function(e){try{var n=e.id,t=e.snippetVersion,o=void 0===t?6:t,u=e.isProduction,a=void 0===u||u;return i.options(e)&&a?(new r(n,o),window.hj):(console.log("%c 🔥 HotJar Tracking Disabled 🔥","color: #fff; background: #35495d; font-size: 14px; border-radius: 5px; padding: 10px 5px; margin: 20px 0;"),!1)}catch(e){return console.error(e),!1}}(n),e.prototype.$hjOptions=n}}}])})); | ||
!function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t=n();for(var r in t)("object"==typeof exports?exports:e)[r]=t[r]}}("undefined"!=typeof self?self:this,(function(){return function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=0)}([function(e,n,t){"use strict";t.r(n);var r=function e(n,t){var r,o,i,u;!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),r=window,o=document,r.hj=r.hj||function(){(r.hj.q=r.hj.q||[]).push(arguments)},r._hjSettings={hjid:n,hjsv:t},i=o.getElementsByTagName("head")[0],(u=o.createElement("script")).async=1,u.src="https://static.hotjar.com/c/hotjar-"+r._hjSettings.hjid+".js?sv="+r._hjSettings.hjsv,i.appendChild(u)};function o(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var i=function(){function e(){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e)}var n,t,r;return n=e,r=[{key:"options",value:function(e){if(function(){var n=new RegExp(/^([0-9])*\d$/g);if(e.id){if(!1===n.test(e.id))throw new Error("Invalid Hotjar Tracking ID");if("string"!=typeof e.id)throw new Error("Hotjar Tracking ID expects a string");return!0}throw new Error("Hotjar Tracking ID is not defined")}()&&function(){if("boolean"!=typeof e.isProduction&&e.isProduction)throw new Error("isProduction expects a boolean");return!0}()&&function(){if("number"!=typeof e.snippetVersion&&e.snippetVersion)throw new Error("snippetVersion expects a number");return!0}())return!0}}],(t=null)&&o(n.prototype,t),r&&o(n,r),e}();function u(e){try{var n=e.id,t=e.snippetVersion,o=void 0===t?6:t,u=e.isProduction,a=void 0===u||u;return i.options(e)&&a?(new r(n,o),window.hj):(console.log("%c 🔥 HotJar Tracking Disabled 🔥","color: #fff; background: #35495d; font-size: 14px; border-radius: 5px; padding: 10px 5px; margin: 20px 0;"),!1)}catch(e){return console.error(e),!1}}n.default={install:function(e,n){"2"===e.version[0]?(e.prototype.$hj=u(n),e.prototype.$hjOptions=n):u(n)}}}])})); |
{ | ||
"name": "vue-hotjar", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Vue Hotjar plugin", | ||
@@ -26,2 +26,3 @@ "scripts": { | ||
"@typescript-eslint/parser": "^2.28.0", | ||
"@vue/test-utils": "^1.1.3", | ||
"babel-loader": "^8.1.0", | ||
@@ -44,2 +45,3 @@ "babel-preset-es2015": "^6.24.1", | ||
"vue": "^2.6.11", | ||
"vue-template-compiler": "^2.6.12", | ||
"webpack": "^4.42.1", | ||
@@ -46,0 +48,0 @@ "webpack-cli": "^3.3.11" |
@@ -24,3 +24,3 @@ <p align="center"> | ||
This is a Vue.js plugin that will allow you to easily add Hotjar to any Vue project. Some key benefits allow you to activate or deactivate tracking based on the environment and in some more advanced use cases you have access to `$hj`. This is a global property that gives you access to the [identify API](https://help.hotjar.com/hc/en-us/articles/360034216634-Hotjar-JavaScript-Functions-Reference) and [other functions](https://help.hotjar.com/hc/en-us/articles/360033640653) to pass data to Hotjar. | ||
This is a VueJs plugin that will allow you to easily add Hotjar to any Vue project. Some key benefits allow you to activate or deactivate tracking based on the environment and in some more advanced use cases you have access to `$hj`. This is a global property that gives you access to the [identify API](https://help.hotjar.com/hc/en-us/articles/360034216634-Hotjar-JavaScript-Functions-Reference) and [other functions](https://help.hotjar.com/hc/en-us/articles/360033640653) to pass data to Hotjar. | ||
@@ -93,6 +93,10 @@ ## Install | ||
instead of accessing HotJar through `window.hj` you can simpaly interact with the API via the a Vue global property `$hj`. | ||
instead of accessing HotJar through `window.hj` you can simply interact with the API via the a Vue global property `$hj`. | ||
__Important To Note:__ The global property `$hj` will return `false` if `isProduction` is set to `false`. Thus it is required to wrap your method in a simple if statement as per the examples below. | ||
__Important To Note:__ | ||
* The global property `$hj` will return `false` if `isProduction` is set to `false`. Thus it is required to wrap your method in a simple if statement as per the examples below. | ||
* This functionality is only available if your Vue version is 2.x.x. For Vue Next users this is disabled for compatibility. | ||
### Track Changes Manually | ||
@@ -112,3 +116,2 @@ ```js | ||
### Identify API *(Business Plan)* | ||
@@ -127,4 +130,5 @@ ```js | ||
* Vue ^3.0.0 | ||
* Vue ^2.0.0 is fully supported. | ||
* Vue ^2.0.0 | ||
* Vue ^3.0.0 is partially supported. TypeScript users will experience issues with typings due to the interface updates in Vue Next. | ||
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
11875
29
131
24