{"repo":"jitsucom/nextlytics","free":true,"listed":false,"github":"https://github.com/jitsucom/nextlytics","clone":"git clone https://github.com/jitsucom/nextlytics.git","description":"Next.js Native Open-Source Analytics","language":"TypeScript","stars":52,"topics":["analytics","google-analytics","jitsu","nextjs","plausible-analytics","segment","typescript"],"license":"MIT","category":"analytics","readme_excerpt":"Nextlytics Next.js Native Open-Source Analytics 100% server-side. No client JavaScript. No cookies. No GDPR banners. Just accurate analytics that respect your users. Website · Integrations · Demo --- What is Nextlytics? Nextlytics is a server-side analytics library for Next.js. It tracks page views automatically via middleware and lets you send custom events from server components, server actions, and API routes. There's no client-side JavaScript involved. Events go directly from your server to your analytics backend. This means no ad blockers, no cookies, and accurate data. It works with multiple backends — Segment, PostHog, Google Analytics, or you can write directly to a database like ClickHouse or Postgres. Install Quick Start 1. Configure your backend ( src/nextlytics.ts ) 2. Add to layout ( src/app/layout.tsx ) 3. Export middleware ( src/middleware.ts ) That's it. Every page view is now tracked server-side. Custom server events Use analytics().sendEvent() to emit your own events from the server. In the App Router (server components, server actions, route handlers) call it with no argument — the request context is read from next/headers : In Pages Router API routes next/headers is unavailable, so pass the request object: This also works for standalone routes with no preceding page render (e.g. email pixels or redirect endpoints) — the event is sent without a parent page-view. A NextRequest (App Router route handler) may be passed the same way. Pages Router Nextlytics als","default_branch":null,"files":null,"tree":[],"storefront":"/r/jitsucom","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/jitsucom/nextlytics/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}