Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

feat: add plausible for analytics

Marc Seitz92a096aae60f
diff --git a/package-lock.json b/package-lock.json
index be8a1083..0494120d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -42,6 +42,7 @@
"ms": "^2.1.3",
"next": "^13.4.19",
"next-auth": "^4.23.1",
+ "next-plausible": "^3.11.1",
"next-themes": "^0.2.1",
"postcss": "^8.4.28",
"react": "18.2.0",
@@ -7015,6 +7016,19 @@
}
}
},
+ "node_modules/next-plausible": {
+ "version": "3.11.1",
+ "resolved": "https://registry.npmjs.org/next-plausible/-/next-plausible-3.11.1.tgz",
+ "integrity": "sha512-Gd+QU+XflVTx65yJ2cNZyrOQLrpz3uKjGLEG4ls+CIVqK3yjsVGCMsEWJcvv1LAeVfHUQtCyp1xyAltLn5Odcg==",
+ "funding": {
+ "url": "https://github.com/4lejandrito/next-plausible?sponsor=1"
+ },
+ "peerDependencies": {
+ "next": "^11.1.0 || ^12.0.0 || ^13.0.0",
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
+ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ }
+ },
"node_modules/next-themes": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/next-themes/-/next-themes-0.2.1.tgz",
@@ -14860,6 +14874,12 @@
"uuid": "^8.3.2"
}
},
+ "next-plausible": {
+ "version": "3.11.1",
+ "resolved": "https://registry.npmjs.org/next-plausible/-/next-plausible-3.11.1.tgz",
+ "integrity": "sha512-Gd+QU+XflVTx65yJ2cNZyrOQLrpz3uKjGLEG4ls+CIVqK3yjsVGCMsEWJcvv1LAeVfHUQtCyp1xyAltLn5Odcg==",
+ "requires": {}
+ },
"next-themes": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/next-themes/-/next-themes-0.2.1.tgz",
diff --git a/package.json b/package.json
index 781ca920..7534bd36 100644
--- a/package.json
+++ b/package.json
@@ -47,6 +47,7 @@
"ms": "^2.1.3",
"next": "^13.4.19",
"next-auth": "^4.23.1",
+ "next-plausible": "^3.11.1",
"next-themes": "^0.2.1",
"postcss": "^8.4.28",
"react": "18.2.0",
diff --git a/pages/_app.tsx b/pages/_app.tsx
index c8d1a079..9dd00ca5 100644
--- a/pages/_app.tsx
+++ b/pages/_app.tsx
@@ -6,6 +6,7 @@ import { SessionProvider } from "next-auth/react";
import { Toaster } from "sonner";
import Head from "next/head";
import { Analytics } from "@vercel/analytics/react";
+import PlausibleProvider from "next-plausible";
import { ThemeProvider } from "@/components/theme-provider";
const inter = Inter({ subsets: ["latin"] });
@@ -21,10 +22,15 @@ export default function App({
</Head>
<SessionProvider session={session}>
<ThemeProvider attribute="class" defaultTheme="dark" enableSystem>
- <main className={inter.className}>
- <Toaster closeButton richColors theme={"dark"} />
- <Component {...pageProps} />
- </main>
+ <PlausibleProvider
+ domain="papermark.io"
+ enabled={process.env.VERCEL_ENV == "production"}
+ >
+ <main className={inter.className}>
+ <Toaster closeButton richColors theme={"dark"} />
+ <Component {...pageProps} />
+ </main>
+ </PlausibleProvider>
</ThemeProvider>
<Analytics />
</SessionProvider>