1.3.5 โ€ข Published 10 months ago

@hexdigital/nuxt-segment v1.3.5

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Nuxt Plausible

npm version npm downloads License Nuxt

Nuxt 3 module to integrate Segment analytics 2.0.

Features

  • ๐Ÿ“ฏ Track events and page views manually with composables
  • ๐Ÿ“ฏ Optionally track page views automatically with the router integration
  • ๐Ÿ“‚ .env file support
  • ๐Ÿงบ Sensible default options
  • ๐Ÿฆพ SSR-ready

Quick Setup

  1. Add @hexdigital/nuxt-segment dependency to your project
# Using pnpm
pnpm add -D @hexdigital/nuxt-segment

# Using yarn
yarn add --dev @hexdigital/nuxt-segment

# Using npm
npm install --save-dev @hexdigital/nuxt-segment

Add @hexdigital/nuxt-segment to the modules section of your Nuxt configuration:

// `nuxt.config.ts`
export default defineNuxtConfig({
  modules: ['@hexdigital/nuxt-segment']
})
  1. Add configuration in nuxtConfig.segment or in nuxtConfig.runtimeConfig.public.segment

This module supports two ways of configuration:

  • Directly in key segment of the Nuxt config: nuxtConfig.segment
  • In public runtimeConfig: nuxtConfig.runtimeConfig.public.segment

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
1.3.5

10 months ago

1.3.4

10 months ago

1.3.3

10 months ago

1.3.2

10 months ago

1.3.1

10 months ago

1.3.0

10 months ago

1.2.3

10 months ago

1.2.2

10 months ago

1.2.1

10 months ago

1.2.0

10 months ago

1.1.5

10 months ago