2.0.1 • Published 1 year ago

swetrix-vue v2.0.1

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

Swetrix Vue 3 integration

npm version Build Status Sourcegraph Netlify Status

Unofficial Swetrix Analytics integration for Vue.js.

Integration

Install

Run the following command to install in your project:

npm install swetrix-vue

Or with yarn:

yarn add swetrix-vue

Or with pnpm:

pnpm add swetrix-vue

Basic usage

You can now import, and use the Swetrix hook on your project:

// ./src/main.ts

import { createApp } from 'vue'
import Swetrix from 'swetrix-vue'

const app = createApp({})

app.use(Swetrix, {
  pid: 'SWETRIX_PROJECT_ID',
  // optional options
  initOptions: {
    // options
  },
  pageViewsOptions: {
    // options
  },
})

Debug-mode

When developing in localhost, Swetrix does not send events to avoid using your quota. \ You can enable debug mode to send events when testing things locally. It will also log messages to console.

// ./src/main.ts

import { createApp } from 'vue'
import Swetrix from 'swetrix-vue'

const app = createApp({})

app.use(Swetrix, {
  pid: 'SWETRIX_PROJECT_ID',
  initOptions: {
    debug: true,
    // other options
  },
})

Advanced options

useSwetrix hook accepts 3 parameters: PID, initOptions, pageViewsOptions. \ See the official documentation page for more details. \ You can always create an issue in case of any questions! 😀

Contribution

Feel free to contribute to the source code by opening a pull requests.

For any questions, you can open an issue, refer to the official Swetrix FAQs page or reach them at contact@swetrix.com.

Self-hosted API

If you are selfhosting the Swetrix-API, be sure to point the apiUrl parameter to: https://yourapiinstance.com/log

Donate

You can support this project by donating me at:

2.0.1

1 year ago

1.1.1

1 year ago

2.0.0

1 year ago

1.1.2

1 year ago

1.1.0

2 years ago

1.1.0-rc.1

2 years ago

1.0.0

2 years ago

1.0.0-rc.4

2 years ago

1.0.0-rc3

2 years ago