next-plausible

Drop-in Plausible Analytics integration for Next.js apps

Library
npm
v4.0.0
708stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
36/100Needs Attention
Development Activity8
Maintenance0
Community48
Maturity60
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
69/100Good
Architecture65
Code Quality68
Innovation62
Learning Curve82

next-plausible wires Plausible Analytics into a Next.js application with minimal setup: a PlausibleProvider component injects the tracking script at the app or page level, and a withPlausibleProxy config wrapper rewrites the script and API endpoint through your own domain to reduce ad-blocker interference. It supports the Pages Router, the App Router, and both server-rendered and statically generated sites.

Beyond pageview tracking, the package exposes a usePlausible hook for firing custom events from client components, with optional TypeScript generics to type-check event names and their properties at compile time.

What You Get

  • A PlausibleProvider component for injecting the Plausible script in _app, a page, or the App Router root layout
  • A withPlausibleProxy Next.js config wrapper that proxies the script and event API through your own domain
  • A usePlausible hook for sending custom events, with optional generic typing of event names and properties
  • Support for Plausible init options like custom properties, file-download tracking, and hash-based routing
  • Configurable proxy paths and script props for advanced deployment setups

Common Use Cases

  • Adding privacy-friendly, cookie-free analytics to a Next.js marketing site or app
  • Proxying the analytics script through a first-party path to avoid ad-blocker false positives
  • Tracking custom conversion events (signups, button clicks) from client components with type-checked event names
  • Migrating a Next.js site from Google Analytics to a lighter, GDPR-friendly alternative

Under The Hood

Architecture - The package is a thin adapter split across three files: lib/PlausibleProvider.tsx renders the Plausible script tag and reads environment context to decide whether tracking is enabled, lib/usePlausible.ts exposes a hook that reads the injected window.plausible function, and lib/withPlausibleProxy.ts wraps a Next.js config object to add rewrites for the proxied script and API paths. Tech Stack - Written in TypeScript, built with tsc plus Rollup into CJS/ESM/type-declaration bundles, tested with Jest and Testing Library across a matrix of proxy configurations (custom domain, base path, trailing slash, App Router) under the test/ directory. Code Quality - The core logic is intentionally small (about 240 lines across the three lib files) with an extensive integration test suite covering proxy edge cases (locale, cookies, sub-paths), though the core provider/hook files themselves have no dedicated unit tests beyond the proxy fixtures. API Design - The public API is minimal and idiomatic React/Next.js: a provider component, one hook, and one config-wrapping function, with TypeScript generics available to type custom event props, keeping the learning curve low for anyone already familiar with Next.js conventions.

Used by 8 apps in this directory

TypeScript
76%
AGPL 3.0

Abby

Developer Tools · Product Management

167

Statically typed feature flags, remote config, and A/B testing with framework-native SDKs for TypeScript teams.

View details
30
Repo Health
70
Technical
63
Dependency
Built with
TypeScript76%
MDX18%
Updated 1 years ago
TypeScript
84%
MIT

Amical

Note Taking · AI Assistants

1,495

Local-first AI dictation that understands your active app — private, offline, and built for speed.

View details
79
Repo Health
82
Technical
67
Dependency
Built with
TypeScript84%
Updated 3 weeks ago
TypeScript
92%
AGPL 3.0

Documenso

Digital Signiture

14,603

Self-hosted, open-source DocuSign alternative with legally binding PDF signatures, multi-party workflows, and a full REST and tRPC API.

View details
93
Repo Health
79
Technical
72
Dependency
Built with
TypeScript92%
Updated today
TypeScript
100%
Other

Dub

Marketing · Analytics

24,521

The open-source link attribution platform for short links, conversion tracking, and affiliate programs — powering 100M+ clicks monthly.

View details
81
Repo Health
78
Technical
65
Dependency
Built with
TypeScript100%
Updated today
Python
63%
Apache 2.0

GPT Researcher

Productivity · AI Assistants

29,039

The pioneering open-source autonomous AI agent that conducts deep, multi-source research and produces citation-backed reports exceeding 2,000 words — faster and more reliably than any human researcher.

View details
88
Repo Health
91
Technical
64
Dependency
Built with
Python63%
TypeScript23%
Updated 1 months ago
TypeScript
100%
MIT

Llama Coder

AI Development · Low Code Platforms

7,115

Generate multi-file web apps from a single prompt using open-source LLMs — an open-source alternative to Claude Artifacts.

View details
71
Repo Health
66
Technical
73
Dependency
Built with
TypeScript100%
Updated 5 days ago
TypeScript
80%
AGPL 3.0

OpenStatus

Monitoring · Devops

8,993

Open-source status pages and uptime monitoring with global synthetic checks, monitoring-as-code, and AI agent integration via MCP.

View details
76
Repo Health
82
Technical
72
Dependency
Built with
TypeScript80%
MDX16%
Updated yesterday
TypeScript
78%
AGPL 3.0

Postiz

Social Media · Automation

34,853

The agentic social media scheduler — AI-powered content creation, 33-platform posting, and team workflows, all self-hosted.

View details
92
Repo Health
70
Technical
67
Dependency
Built with
TypeScript78%
JavaScript12%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search