# @rovahub/vue-hotjar

> This Vue2 plugin injects a Hotjar into all of your vue instances

Latest version **1.0.1** (published 2023-10-11) · Apache-2.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @rovahub/vue-hotjar
pnpm add @rovahub/vue-hotjar
yarn add @rovahub/vue-hotjar
bun add @rovahub/vue-hotjar
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2023-10-11 |
| First published | 2023-09-07 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 11.1 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | RovaHub Technologies |
| Maintainers | ngocquy0201 |
| Keywords | hotjar, vue-hotjar, nuxt-hotjar, rovahub, rovahub technologies |

## Links

- npm: https://www.npmjs.com/package/@rovahub/vue-hotjar
- Repository: https://github.com/rovahub/vue-hotjar
- Homepage: https://github.com/rovahub/vue-hotjar#readme
- Issues: https://github.com/rovahub/vue-hotjar/issues
- npm.io page: https://npm.io/package/@rovahub/vue-hotjar

## Dependencies (2)

- [vue](https://npm.io/package/vue.md) ^2.7.14
- [@hotjar/browser](https://npm.io/package/@hotjar/browser.md) ^1.0.9

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2023-10-11
- 1.0.0 — 2023-09-07

## README

<p align="left">
  <img height="200" src="https://raw.githubusercontent.com/rovahub/vue-hotjar/master/images/hotjar.svg" alt="Hotjar logo">
</p>

[![](https://img.shields.io/npm/v/%40rovahub%2Fvue-hotjar/latest.svg?style=flat-square)](https://npmjs.com/package/%40rovahub%2Fvue-hotjar)
[![](https://img.shields.io/npm/dt/%40rovahub%2Fvue-hotjar.svg?style=flat-square)](https://npmjs.com/package/%40rovahub%2Fvue-hotjar)

# @rovahub/vue-hotjar

This Vue2 plugin injects a Hotjar into all of your vue instances

## Install

``` bash
# Npm
npm install @rovahub/vue-hotjar --save

# Yarn
yarn add @rovahub/vue-hotjar
```

## Quickstart

### Vue 2

Import the @rovahub/vue-hotjar in your main JavaScript file in src/ folder.

```bash
# src/main.js

import Vue from "vue";
import App from "./App.vue";
import HotjarPlugin from "@rovahub/vue-hotjar";

Vue.config.productionTip = false;

Vue.use(HotjarPlugin, {
  siteId: 111
});

new Vue({
  render: h => h(App)
}).$mount("#app");

```

### Nuxt JS

Create JS file in /plugins/ folder and add content to the plugin file.

```bash
# plugins/vue-hotjar.js

import Vue from 'vue';
import HotjarPlugin from "@rovahub/vue-hotjar";

Vue.use(HotjarPlugin, {
  siteId: 111
});
```

In your nuxt.config.js file, add the plugin to the plugins array:

```bash
# nuxt.config.js

module.exports = {
  // ...
  plugins: [
    { src: "~/plugins/vue-hotjar.js", mode: "client" }
  ],
  // ...
}
```

### Use
```bash
methods: {
  handleClickButton(){
    this.$hotjar.event('click-button');
  }
}
```

## Options

You can provide additional options to customize the Hotjar:

```bash
Vue.use(HotjarPlugin, {
    siteId: 111,
    debug: true;
    version: 6;
    nonce: 'rAnDoM';
});
```
## Methods

 Method                                  | Feature            
-----------------------------------------|--------------------
 this.$hotjar.identify(userId, userInfo) | Identify API       
 this.$hotjar.event(actionName)          | Events API         
 this.$hotjar.stateChange(newPage)       | Manual URL changes 
 this.$hotjar.isReady()                  | Hotjar isReady

---
_Source: https://npm.io/package/@rovahub/vue-hotjar · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
