# vue-countly

> Countly plugin for Vue 3.

Latest version **2.0.0** (published 2022-02-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-countly
pnpm add vue-countly
yarn add vue-countly
bun add vue-countly
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2022-02-07 |
| First published | 2019-01-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Chen Fengyuan |
| Maintainers | chenfengyuan |
| Keywords | countly, vue, vue3, vue-plugin, front-end, web |

## Links

- npm: https://www.npmjs.com/package/vue-countly
- Repository: https://github.com/fengyuanchen/vue-countly
- Homepage: https://fengyuanchen.github.io/vue-countly
- Issues: https://github.com/fengyuanchen/vue-countly/issues
- npm.io page: https://npm.io/package/vue-countly

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2022-02-07
- 2.0.0-rc (next) — 2021-02-27
- 2.0.0-beta.1 — 2021-02-11
- 2.0.0-beta — 2021-02-11
- 1.0.0 — 2019-01-23

## README

# vue-countly

[![Coverage Status](https://img.shields.io/codecov/c/github/fengyuanchen/vue-countly.svg)](https://codecov.io/gh/fengyuanchen/vue-countly) [![Downloads](https://img.shields.io/npm/dm/vue-countly.svg)](https://www.npmjs.com/package/vue-countly) [![Version](https://img.shields.io/npm/v/vue-countly.svg)](https://www.npmjs.com/package/vue-countly) [![Gzip Size](https://img.shields.io/bundlephobia/minzip/vue-countly.svg)](https://unpkg.com/vue-countly/dist/vue-countly.js)

> [Countly](https://resources.count.ly/docs/countly-sdk-for-web) plugin for Vue 3. For Vue 2, check out the [`v1`](https://github.com/fengyuanchen/vue-countly/tree/v1) branch.

## Main files

```text
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:

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

Using pnpm:

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

Using Yarn:

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

Using CDN:

```html
<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

```js
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](https://support.count.ly/hc/en-us/articles/360037441932-Web-analytics-JavaScript-#setup-properties) of Countly.

## Browser support

Same as Vue 3.

## Versioning

Maintained under the [Semantic Versioning guidelines](https://semver.org/).

## License

[MIT](https://opensource.org/licenses/MIT) © [Chen Fengyuan](https://chenfengyuan.com/)

---
_Source: https://npm.io/package/vue-countly · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
