https://github.com/valaxyjs/valaxy-addon-vercount
A Vercount API based counting plugin for Valaxy, serving as an alternative to Busuanzi counting. 基于 Vercount API 实现的 Valaxy 计数插件, 用于不蒜子计数替代方案
https://github.com/valaxyjs/valaxy-addon-vercount
busuanzi valaxy valaxy-addon vercount
Last synced: 3 months ago
JSON representation
A Vercount API based counting plugin for Valaxy, serving as an alternative to Busuanzi counting. 基于 Vercount API 实现的 Valaxy 计数插件, 用于不蒜子计数替代方案
- Host: GitHub
- URL: https://github.com/valaxyjs/valaxy-addon-vercount
- Owner: valaxyjs
- Created: 2024-07-02T03:42:01.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2025-08-25T09:13:26.000Z (11 months ago)
- Last Synced: 2025-10-28T10:51:56.312Z (8 months ago)
- Topics: busuanzi, valaxy, valaxy-addon, vercount
- Language: TypeScript
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
valaxy-addon-vercount
A Vercount API based counting plugin for Valaxy, serving as an alternative to Busuanzi counting
- English | [简体中文](./README.zh-CN.md)
## Features
- ⚡ High-speed response, server response time less than 10ms
- 🌎 Option to use China accelerated version or default Vercel global CDN for the API
- 📊 Statistics through POST requests, supporting mobile devices and various browsers, with high accuracy
- 🔒 Use of JSON callbacks to avoid CSRF attacks
- 🔄 Automatically synchronizes all Busuanzi data
## Installing this Plugin
```bash
pnpm add valaxy-addon-vercount
```
```ts
import { defineValaxyConfig } from 'valaxy'
import { addonVercount } from 'valaxy-addon-vercount'
export default defineValaxyConfig({
addons: [
addonVercount(),
],
})
```
## Using this Plugin
```vue
import { useAddonVercount } from 'valaxy-addon-vercount'
const { page, site } = useAddonVercount()
Article reads: {{ page.pv }}
Article visitors: {{ page.uv }}
Site visits: {{ site.pv }}
Site visitors: {{ site.uv }}
```
## Configuration / Options
| Name | Type | Default | Description |
| ---- | ---- | ---- | ---- |
| api | `string` | --- | Fill in 'cn' for the China optimized version, or other values for custom API |
| baseUrl | `string` | --- | Gets the source of the current page, default is automatically `window.location.origin` |
| placeholder | `string` \| `number` \| `null` | `'-'` | Placeholder for visit count |
## Thanks
- [Vercount](https://github.com/EvanNotFound/vercount)
- [busuanzi](https://busuanzi.ibruce.info/)