Socket
Book a DemoInstallSign in
Socket

@huntersofbook/core-nuxt

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@huntersofbook/core-nuxt

huntersofbook offers specific tools for the vue ecosystem.

latest
Source
npmnpm
Version
0.4.1
Version published
Maintainers
1
Created
Source

alt text

Plausible Nuxt 3 Module

This module huntersofbook team created.

Plausible integration for Nuxt

Features

  • Zero-config required
  • Auto-import composables usePlausible()

Setup

pnpm add @huntersofbook/plausible-nuxt
yarn add @huntersofbook/plausible-nuxt
pnpm add @huntersofbook/plausible-nuxt

Nuxt Config

export default defineNuxtConfig({
  modules: [
    '@huntersofbook/plausible-nuxt'
  ],
  plausible: {
    init: {
      domain: 'localhost',
      apiHost: 'https://site.com',
      trackLocalhost: true
    }
  }
})

Composables

<script setup lang="ts">
const { trackEvent } = usePlausible()
</script>

<template>
  <div>
    <button @click="trackEvent('nuxt')">
      click me
    </button>
  </div>
</template>
<script setup lang="ts">
const { trackPageview } = usePlausible()
</script>

Init Default

Plausible() accepts some options that you may want to provide:

OptionTypeDescriptionDefault
domainstringYour site's domain, as declared by you in Plausible's settingslocation.hostname
hashModeboolEnables tracking based on URL hash changes.false
trackLocalhostboolEnables tracking on localhost.false
apiHoststringPlausible's API host to use. Change this if you are self-hosting.'https://plausible.io'

Settings Default

OptionTypeDescriptionDefault
enableAutoPageviewsboolYour site's domain, as declared by you in Plausible's settingstrue
enableAutoOutboundTrackingboolEnables tracking based on URL hash changes.false

💻 Development

  • Clone this repository
  • Enable Corepack using corepack enable (use npm i -g corepack for Node.js < 16.10)
  • Install dependencies using pnpm install
  • Stub module with pnpm dev:prepare
  • Run pnpm dev to start playground in development mode

License

MIT License © 2022-PRESENT productdevbook

💚 Credits

Nuxt 3 Plugin danielroe

Keywords

nuxt 3

FAQs

Package last updated on 25 Oct 2022

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