vue-countly

Countly plugin for Vue 3.
3,728 11
Install
npm install vue-countly
Latest Version:2.0.0
Vue:3
Older releases:2
License:MIT
Last Updated:Feb 19, 2022
Links: GitHub  ·  npm
Maintainer: chenfengyuan

vue-countly

Coverage Status Downloads Version Gzip Size

Countly plugin for Vue 3. For Vue 2, check out the v1 branch.

Main files

dist/
├── vue-countly.js         (UMD, default)
├── vue-countly.min.js     (UMD, compressed)
├── vue-countly.esm.js     (ECMAScript Module)
├── vue-countly.esm.min.js (ECMAScript Module, compressed)
└── vue-countly.d.ts       (TypeScript Declaration File)

Getting started

Installation

Using npm:

npm install vue@3 countly-sdk-web@21 vue-countly@2

Using pnpm:

pnpm add vue@3 countly-sdk-web@21 vue-countly@2

Using Yarn:

yarn add vue@3 countly-sdk-web@21 vue-countly@2

Using CDN:

<script src="https://unpkg.com/vue@3"></script><!-- Vue.js is required -->
<script src="https://unpkg.com/countly-sdk-web@21"></script><!-- Countly is required -->
<script src="https://unpkg.com/vue-countly@2"></script>

Usage

import { createApp, defineComponent } from 'vue';
import Countly from 'countly-sdk-web';
import VueCountly from 'vue-countly';

const app = createApp({
  created() {
    console.log(this.$Countly === Countly);
    // > true

    // Track sessions automatically (recommended)
    this.$Countly.q.push(['track_sessions']);

    // Track web page views automatically (recommended)
    this.$Countly.q.push(['track_pageview']);
  },
});

// Inject the `$Countly` property into all components within the application.
app.use(VueCountly, Countly, {
  app_key: 'YOUR_APP_KEY',
  url: 'https://yourdomain.com/',
});
app.mount(document.body);

See the available initialization config options of Countly.

Browser support

Same as Vue 3.

Versioning

Maintained under the Semantic Versioning guidelines.

License

MIT © Chen Fengyuan

Related Packages

pangea-lib

Installation

145,633
@nx/vue

The Vue plugin for Nx contains executors and generators for managing Vue applica...

2,627,680 29,434
@nx/nuxt

The Nuxt plugin for Nx contains executors and generators for managing Nuxt appli...

784,947 29,434
burger-ui

A Simple Component Library For Vue3

1,027
@ohos-ports/nx-nuxt

The Nuxt plugin for Nx contains executors and generators for managing Nuxt appli...

0 6

Version History

Version Released Vue License
2.0.0 ^3.0.0 MIT
1.0.0 ^2.0.0 MIT
Pre-releases (3)
Version Released Vue License
2.0.0-rc ^3.0.0 MIT
2.0.0-beta.1 ^3.0.0 MIT
2.0.0-beta ^3.0.0 MIT