{"_id":"@0kzh/hotjar","_rev":"1-dbb6103d736519f44987230b4199fc39","name":"@0kzh/hotjar","dist-tags":{"latest":"1.1.1"},"versions":{"1.1.0":{"name":"@0kzh/hotjar","version":"1.1.0","description":"Bring Hotjar directly to your application","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","scripts":{"build":"rollup -c && tsc -d --emitDeclarationOnly","test":"jest","build-demo":"npm run build && webpack --config ./demo/webpack.config.demo.js","run-demo":"npm run build && webpack serve --config ./demo/webpack.config.demo.js","deploy-demo":"npm run build-demo && gh-pages -d demo_dist","coverage":"jest --collectCoverage","lint-check":"eslint 'src/**/*.{js,ts,tsx}'","lint-fix":"eslint 'src/**/*.{js,ts,tsx}' --fix","release":"standard-version"},"repository":{"type":"git","url":"git+https://github.com/hotjar/hotjar-js.git"},"author":"","license":"MIT","bugs":{"url":"https://github.com/hotjar/hotjar-js/issues"},"homepage":"https://github.com/hotjar/hotjar-js#readme","devDependencies":{"@babel/core":"^7.14.0","@babel/preset-env":"^7.14.1","@babel/preset-typescript":"^7.13.0","@rollup/plugin-commonjs":"^19.0.0","@rollup/plugin-typescript":"^8.2.1","@types/jest":"^26.0.23","@typescript-eslint/eslint-plugin":"^4.22.1","@typescript-eslint/parser":"^4.22.1","babel-jest":"^26.6.3","copy-webpack-plugin":"^8.1.1","css-loader":"^5.2.4","eslint":"^7.26.0","eslint-config-prettier":"^8.3.0","eslint-plugin-jest":"^24.3.6","eslint-plugin-prettier":"^3.4.0","gh-pages":"^3.1.0","html-webpack-plugin":"^5.3.1","jest":"^26.6.3","prettier":"^2.3.0","rollup":"^2.47.0","rollup-plugin-terser":"^7.0.2","standard-version":"^9.3.0","style-loader":"^2.0.0","ts-jest":"^26.5.6","tslib":"^2.2.0","typescript":"^4.2.4","webpack":"^5.37.0","webpack-cli":"^4.7.0","webpack-dev-server":"^3.11.2"},"jest":{"verbose":true,"coverageProvider":"v8","coverageReporters":["text"],"coverageThreshold":{"global":{"branches":90,"functions":90,"lines":90}},"transform":{"^.+\\.ts?$":"ts-jest"}},"_id":"@0kzh/hotjar@1.1.0","gitHead":"447d6e571c33c023acbcf6b8c7f12c90c051cf0a","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-fZV0VNxFUJSgGJENpGBqcDr3Me9goxboxY51CO/GwFu3Iun8HL34GX9k+1/6d+YAoiDE7JVNJB/x/wCTz/YbZg==","shasum":"0238f433610de0a0de1939385863822306a14fe4","tarball":"https://registry.npmjs.org/@0kzh/hotjar/-/hotjar-1.1.0.tgz","fileCount":3,"unpackedSize":5712,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLI5cXEwoD++6z02gKbvFPmkczUWzQiiI3LBlq25ccOQIhAPCGYs6XKciFQzacWY2ICshAzNfmaCYEwhLELFNJmT0b"}]},"_npmUser":{"name":"0kzh","email":"me@kelvinzhang.ca"},"directories":{},"maintainers":[{"name":"0kzh","email":"me@kelvinzhang.ca"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hotjar_1.1.0_1703720775870_0.4569563341945879"},"_hasShrinkwrap":false},"1.1.1":{"name":"@0kzh/hotjar","version":"1.1.1","description":"Bring Hotjar directly to your application","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","scripts":{"build":"rollup -c && tsc -d --emitDeclarationOnly","test":"jest","build-demo":"npm run build && webpack --config ./demo/webpack.config.demo.js","run-demo":"npm run build && webpack serve --config ./demo/webpack.config.demo.js","deploy-demo":"npm run build-demo && gh-pages -d demo_dist","coverage":"jest --collectCoverage","lint-check":"eslint 'src/**/*.{js,ts,tsx}'","lint-fix":"eslint 'src/**/*.{js,ts,tsx}' --fix","release":"standard-version"},"repository":{"type":"git","url":"git+https://github.com/hotjar/hotjar-js.git"},"author":"","license":"MIT","bugs":{"url":"https://github.com/hotjar/hotjar-js/issues"},"homepage":"https://github.com/hotjar/hotjar-js#readme","devDependencies":{"@babel/core":"^7.14.0","@babel/preset-env":"^7.14.1","@babel/preset-typescript":"^7.13.0","@rollup/plugin-commonjs":"^19.0.0","@rollup/plugin-typescript":"^8.2.1","@types/jest":"^26.0.23","@typescript-eslint/eslint-plugin":"^4.22.1","@typescript-eslint/parser":"^4.22.1","babel-jest":"^26.6.3","copy-webpack-plugin":"^8.1.1","css-loader":"^5.2.4","eslint":"^7.26.0","eslint-config-prettier":"^8.3.0","eslint-plugin-jest":"^24.3.6","eslint-plugin-prettier":"^3.4.0","gh-pages":"^3.1.0","html-webpack-plugin":"^5.3.1","jest":"^26.6.3","prettier":"^2.3.0","rollup":"^2.47.0","rollup-plugin-terser":"^7.0.2","standard-version":"^9.3.0","style-loader":"^2.0.0","ts-jest":"^26.5.6","tslib":"^2.2.0","typescript":"^4.2.4","webpack":"^5.37.0","webpack-cli":"^4.7.0","webpack-dev-server":"^3.11.2"},"jest":{"verbose":true,"coverageProvider":"v8","coverageReporters":["text"],"coverageThreshold":{"global":{"branches":90,"functions":90,"lines":90}},"transform":{"^.+\\.ts?$":"ts-jest"}},"_id":"@0kzh/hotjar@1.1.1","gitHead":"447d6e571c33c023acbcf6b8c7f12c90c051cf0a","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-800BmDxwPy+46tZDzf4LvhS9e23K/ttG+MKFmDZpy9PYAvim+tC0GyAG5rhU2sSM4SzZ9OVmFAvPMTltCn7izQ==","shasum":"2fbcb11e16c98116049713c15fb4c583db26fcbb","tarball":"https://registry.npmjs.org/@0kzh/hotjar/-/hotjar-1.1.1.tgz","fileCount":9,"unpackedSize":19382,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCF2r63K2tQj7slpmSrF+gr5FpFfBM7CoTTgNPv2igsxAIhAOFakgCKReTcg3Iu+LM3wibeAx/XRBkUAKcESGuIB1qm"}]},"_npmUser":{"name":"0kzh","email":"me@kelvinzhang.ca"},"directories":{},"maintainers":[{"name":"0kzh","email":"me@kelvinzhang.ca"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hotjar_1.1.1_1703720839098_0.37941893677548855"},"_hasShrinkwrap":false}},"time":{"created":"2023-12-27T23:46:15.781Z","1.1.0":"2023-12-27T23:46:16.089Z","modified":"2023-12-27T23:47:19.439Z","1.1.1":"2023-12-27T23:47:19.269Z"},"maintainers":[{"name":"0kzh","email":"me@kelvinzhang.ca"}],"description":"Bring Hotjar directly to your application","homepage":"https://github.com/hotjar/hotjar-js#readme","repository":{"type":"git","url":"git+https://github.com/hotjar/hotjar-js.git"},"bugs":{"url":"https://github.com/hotjar/hotjar-js/issues"},"license":"MIT","readme":"# @hotjar/browser\n\n[![@hotjar/browser](https://img.shields.io/npm/v/@hotjar/browser.svg?label=@hotjar/browser)](https://www.npmjs.com/package/@hotjar/browser)\n\n> Bring [Hotjar](https://www.hotjar.com/) directly to your application\n\n## Installation\n\nAdd this package as a dependency in your project, then import the library in your code.\n\n```bash\nyarn add @hotjar/browser\n```\n\n```javascript\nimport Hotjar from '@hotjar/browser';\n```\n\n## Initialize Hotjar\n\nIn order for Hotjar to run, it needs to be initialized with your site ID.\nYou can find your site ID on [this page](https://insights.hotjar.com/site/list) just before your site name.\n\n```javascript\nconst siteId = 123;\nconst hotjarVersion = 6;\n\nHotjar.init(siteId, hotjarVersion);\n\n// Initializing with `debug` option:\nHotjar.init(siteId, hotjarVersion, {\n  debug: true\n});\n```\n\n## Identify API\n\nOne of the main interest of this library is to be able to use [Hotjar Identify API](https://help.hotjar.com/hc/en-us/articles/360033640653-Identify-API-Reference).\n\n```javascript\nconst userId = 'abc_123';\nconst firstName = 'John';\nconst favoriteColor = 'blue';\n\nHotjar.identify(userId, {\n  first_name: firstName,\n  color: favoriteColor,\n});\n```\n\n## Events API\n\nYou 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\").\n\n```javascript\nconst actionName = 'error';\nHotjar.event(actionName);\n```\n\n## Manual URL changes\n\nDepending on how your website routing works, you might need to manually instruct Hotjar when a route change has happened. [More details about URL changes](https://help.hotjar.com/hc/en-us/articles/360034378534).\n\n```javascript\nconst newPage = '/new';\n\nHotjar.stateChange(newPage);\n```\n\n## CSP\n\nIf the project uses [CSP](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP), you can add a special string to your server response headers so that the HotJar script loads without problems\n\n```javascript\n// Initializing with `nonce` option:\nHotjar.init(siteId, hotjarVersion, {\n  nonce: 'rAnDoM'\n});\n```\n\n```\nContent-Security-Policy: \n  script-src *.hotjar.com 'nonce-rAnDoM'; \n  frame-src *.hotjar.com;\n```\n\n## Example\n\nYou can find a working example on [GitHub Pages](https://hotjar.github.io/hotjar-js/).\n","readmeFilename":"README.md"}