Socket
Book a DemoInstallSign in
Socket

nuxt-module-hotjar

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuxt-module-hotjar

Add HotJar to your Nuxt.js application

latest
Source
npmnpm
Version
1.3.4
Version published
Maintainers
1
Created
Source

343866793-35f88f27-93d3-4fe1-9479-798414ea7353

Nuxt Hotjar

Easily add Hotjar for tracking and analytics to your Nuxt application.

npm version npm downloads License Nuxt

Features

  • 🔥 Easily add Hotjar to your Nuxt application
  • 👮 Data privacy
  • 🏷️ Fully typed
  • 🦾 SSR support

Setup

npx nuxi@latest module add hotjar

Configuration

Add nuxt-module-hotjar to the modules section of nuxt.config.ts and provide your Hotjar site id and the script version.

In order for Nuxt Hotjar to run, it needs to be initialized with your site ID (this is the hotjarId in our module). You can find your site ID on this page just before your site name.

export default defineNuxtConfig({
  modules: [
    'nuxt-module-hotjar'
  ],

  hotjar: {
    hotjarId: 1234567,
    scriptVersion: 6,

    // optionally you can turn on debug mode for development
    debug: true
  }
})

Basic usage

Now you have to initialize Hotjar in your app with the composable useHotjar:

// In you app.vue file for example when you user has given consent:

const { initialize } = useHotjar()

function onConsent() {
  initialize()
}

Composables

useHotjar

The SSR-safe useHotjar composable provides access to:

  • The initialize method

You can use it like this:

const { initialize } = useHotjar()

Types declarations

function useHotjar(): {
  initialize: () => void
}

Modules Options

OptionTypeDefaultDescription
hotjarIdnumberundefinedYour Hotjar site_id.
scriptVersionnumber6By default it's 6, you don’t necessarily need to change it.
debugbooleanfalseDebug mode

Credits

Development

# Install dependencies
npm install

# Generate type stubs
npm run dev:prepare

# Develop with the playground
npm run dev

# Build the playground
npm run dev:build

# Run ESLint
npm run lint

# Run Vitest
npm run test
npm run test:watch

# Release new version
npm run release

Keywords

hotjar

FAQs

Package last updated on 06 Sep 2025

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.