1.0.1 • Published 1 year ago

@huntersofbook/plausible-nuxt v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

alt text

Plausible Nuxt 3 Module

@huntersofbook/plausible-nuxt npm

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
    },
    // If this is loaded you can make it true, https://github.com/nuxt-modules/partytown
    partytown: false,
  }
})

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

1.0.1

1 year ago

1.0.0

1 year ago

0.4.8

1 year ago

0.5.0

1 year ago

0.5.2

1 year ago

0.5.1

1 year ago

0.4.7

2 years ago

0.3.9

2 years ago

0.3.10-beta.9

2 years ago

0.4.1-beta.0

2 years ago

0.3.10-beta.0

2 years ago

0.3.10-beta.14

2 years ago

0.3.10-beta.13

2 years ago

0.3.10-beta.12

2 years ago

0.3.10-beta.11

2 years ago

0.3.10-beta.10

2 years ago

0.3.10-beta.7

2 years ago

0.3.10-beta.8

2 years ago

0.3.10-beta.5

2 years ago

0.3.10-beta.6

2 years ago

0.3.10-beta.3

2 years ago

0.3.10-beta.4

2 years ago

0.3.10-beta.2

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.8

2 years ago

0.3.7

2 years ago

0.4.1

2 years ago

0.3.2

2 years ago

0.4.0

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.6

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.27

2 years ago

0.0.26

2 years ago

0.0.25

2 years ago