https://github.com/ordinary-dev/next-shynet
A library for integrating Shynet (self-hosted privacy-friendly web analytics) into your next.js project.
https://github.com/ordinary-dev/next-shynet
analytics monitoring nextjs shynet typescript web-analytics
Last synced: about 1 year ago
JSON representation
A library for integrating Shynet (self-hosted privacy-friendly web analytics) into your next.js project.
- Host: GitHub
- URL: https://github.com/ordinary-dev/next-shynet
- Owner: ordinary-dev
- License: mit
- Archived: true
- Created: 2022-11-20T12:39:22.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-05-01T10:08:36.000Z (about 2 years ago)
- Last Synced: 2025-03-13T22:09:45.454Z (over 1 year ago)
- Topics: analytics, monitoring, nextjs, shynet, typescript, web-analytics
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/next-shynet
- Size: 412 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: readme.md
- License: license.txt
Awesome Lists containing this project
README
# Next-Shynet
A library for integrating [shynet](https://github.com/milesmcc/shynet)
into your [next.js](https://nextjs.org/) project.
It helps to easily use shynet in a single page application.
The library also has declarations for typescript.
## Usage
Install this library:
```bash
npm install next-shynet
```
### App router
Change your `app/layout.tsx`:
```jsx
import { ShynetForAppRouter } from "next-shynet"
export default async function RootLayout({children}) {
return (
)
}
```
### Pages router
Change your `_app.js`:
```jsx
import Shynet from "next-shynet"
const YourApp = ({ Component, pageProps }) => (
)
```
The link to the tracking pixel is optional.
By default, the script is not loaded during development.
To force the script to be included, add the `ignoreEnv` option:
```jsx
```
## How to build
```bash
npm install
npm run build
```
The generated files will be in the `/dist` directory.
## Authors
- Ivan Reshetnikov