Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
react-use-hotjar
Advanced tools
Adds Hotjar capabilities as custom hooks to your project
Statements | Branches | Functions | Lines |
---|---|---|---|
npm install --save react-use-hotjar
import * as React from 'react';
import useHotjar from 'react-use-hotjar';
const myCustomLogger = console.info;
const HotjarReadyApp = () => {
const { initHotjar } = useHotjar();
React.useEffect(() => {
initHotjar(1234567, 6, false, myCustomLogger);
}, [initHotjar]);
return <App />;
};
import * as React from 'react';
import useHotjar from 'react-use-hotjar';
const myCustomLogger = console.log;
const MyCustomComponent = () => {
const { identifyHotjar } = useHotjar();
const handleUserInfo = (userInfo) => {
const { id, ...restUserInfo } = userInfo;
identifyHotjar(id, restUserInfo, myCustomLogger);
};
};
useHotjar()
returns:
key | description | arguments | example |
---|---|---|---|
readyState | States if Hotjar is ready | N/A | N/A |
initHotjar | Initialize method | (hotjarId: number, hotjarVersion: number, hotjarDebug?: boolean, loggerCallback?: console[method]) | (1933331, 6, false, console.info) |
identifyHotjar | User identify API method | (userId: string, userInfo: object, loggerCallback?: console[method]) | ('abcde-12345-12345', {name:"Olli",surname:"Parno",address:"Streets of Tomorrow"}, console.log) |
stateChange | Relative path state change | (relativePath: string, loggerCallback?: console[method]) | ('route/logged-route/user?registered=true') |
tagRecording | Tag a recording | (tags: string[], loggerCallback?: console[method]) | (['tag1', 'tag2']) |
hotjarId
: Your Hotjar application ID ex.: 1933331hotjarVersion
: Hotjar's current version ex.: 6hotjarDebug
: Optional Debug Mode to see hotjar logs in console ex.: truelogCallback
: Optional callback for logging whether Hotjar is ready or notinitHotjar: (
hotjarId: string,
hotjarVersion: string,
hotjarDebug?: boolean,
logCallback?: () => void
) => boolean;
userId
: Unique user's identification as stringuserInfo
: User info of key-value pairs (note this must not be so long and deep according to docs) (Please note: The Identify API is only available to Business plan customers.)logCallback
: Optional callback for logging whether Hotjar identified user or notidentifyHotjar: (userId: string, userInfo: object, logCallback?: () => void) =>
boolean;
relativePath
: A change in a route specially for SPAs usage. stateChange docslogCallback
: Optional callback for logging whether Hotjar stateChange was called or notstateChange: (relativePath: string, logCallback?: () => void) => boolean;
tags
: List of strings to associate with a recording that can be used for filteringlogCallback
: Optional callback for logging whether Hotjar tagRecording was called or nottagRecording: (tags: string[], logCallback?: () => void) => boolean;
Thanks goes to these wonderful people (emoji key):
Olavo Parno 🤔 💻 ⚠️ | Gianpietro Lavado 📖 | Ivan Kleshnin 💻 🤔 | Ajay Varghese 💻 🤔 | honicole 🔧 💻 🤔 📖 | Georg Bakken Idland 📖 🤔 | Jason Papakostas 🐛 |
Luighi Viton-Zorrilla 🐛 🚧 | Quentin Luc 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!
react-use-hotjar is MIT licensed.
This hook is created using create-react-hook.
FAQs
Adds Hotjar capabilities as custom hooks
The npm package react-use-hotjar receives a total of 1,114 weekly downloads. As such, react-use-hotjar popularity was classified as popular.
We found that react-use-hotjar demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.