https://github.com/deryeger/page-views
A privacy-friendly counter for page views.
https://github.com/deryeger/page-views
analytics privacy views-count
Last synced: 5 months ago
JSON representation
A privacy-friendly counter for page views.
- Host: GitHub
- URL: https://github.com/deryeger/page-views
- Owner: DerYeger
- License: mit
- Created: 2022-07-25T07:48:57.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-09-03T07:13:55.000Z (over 3 years ago)
- Last Synced: 2025-06-28T22:18:50.964Z (7 months ago)
- Topics: analytics, privacy, views-count
- Language: TypeScript
- Homepage: https://page-views.yeger.eu
- Size: 1.42 MB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
@yeger/page-views
A privacy-friendly counter for page views.
# Features
- 🕵🏻♂️ **Privacy-friendly**: No user-tracking. Clients decide when to submit a page view.
- 🪶 **Lightweight & Simple**: Less than a kilobyte gzipped. Can be configured to automatically submit views, even after client-side navigation.
- 💻 **Self-hostable**: By default, a public instance of the backend is used. Alternatively, a self-hosted instance or a custom backend adhering to the scheme can be used.
## Installation
```bash
# yarn
$ yarn add @yeger/page-views
# npm
$ npm install @yeger/page-views
```
## Usage
```typescript
import PageViews from '@yeger/page-views'
// Manually submit a view of the current page
await PageViews.submitView()
// Automatically submit views
PageViews.autoSubmitViews()
// Get views of current page
await PageViews.getViews()
```
### Examples
React and Vue examples can be found [here](https://page-views.yeger.eu/examples/).
## Development
```bash
# install dependencies
$ yarn install
# build for production
$ yarn build
# build in watch mode
$ yarn dev
# lint project files
$ yarn lint
# serve docs
$ yarn docs:dev
```
## License
[MIT](./LICENSE) - Copyright © Jan Müller