Skip to content

v1.3.0

Choose a tag to compare

@damevin damevin released this 27 Jun 17:41
· 20 commits to main since this release
3d06c01

compare changes

πŸ”₯ BREAKING CHANGES:

Manual Initialization Required

We've removed the automatic plugin initialization. You now need to manually initialize the Hotjar script using the new useHotjar composable.

Basic Usage

Initialize Hotjar in your app after obtaining user consent:

// In your app.vue or equivalent:

const { initialize } = useHotjar()

function onUserConsent() {
  initialize()
}

New Composable: useHotjar

The SSR-safe useHotjar composable provides:

  • initialize: Function to manually start Hotjar
  • isHotjarEnabled: Reactive variable to check Hotjar's status

Usage:

import { useHotjar } from '@nuxtjs/hotjar'

const { initialize, isHotjarEnabled } = useHotjar()

// Initialize when ready
initialize()

// Check if Hotjar is active
console.log(isHotjarEnabled.value)

This change gives you more control over when Hotjar loads, improving performance and compliance with user consent requirements.

πŸš€ Enhancements

  • ✨ use composable instead of plugin for manually init the script (d5ad0f8)

πŸ“– Documentation

  • πŸ“ improve README (8a72567)
  • πŸ“ update playground (c65483f)

🏑 Chore

❀️ Contributors