Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

Update package and layout configurations

Bill Yang72137531e7b7
diff --git a/docs/package-lock.json b/docs/package-lock.json
index 6b20bb281..364363fc3 100644
--- a/docs/package-lock.json
+++ b/docs/package-lock.json
@@ -1,10 +1,10 @@
{
- "name": "example-docs",
+ "name": "rybbit-docs",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
- "name": "example-docs",
+ "name": "rybbit-docs",
"license": "MIT",
"dependencies": {
"@radix-ui/react-accordion": "1.2.10",
@@ -20,6 +20,7 @@
"next-mdx-remote": "^5.0.0",
"nextra": "^4.2.17",
"nextra-theme-docs": "4.2.17",
+ "posthog-js": "^1.249.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-tweet": "3.2.2",
@@ -2804,6 +2805,16 @@
"integrity": "sha512-1NB+BKqhtNipMsov4xI/NnhCKp9XG9NamYp5PVm9klAT0fsrNPjaFICsCFhNhwZJKNh7zB/3q8qXz0E9oaMNtQ==",
"license": "MIT"
},
+ "node_modules/core-js": {
+ "version": "3.42.0",
+ "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.42.0.tgz",
+ "integrity": "sha512-Sz4PP4ZA+Rq4II21qkNqOEDTDrCvcANId3xpIgB34NDkWc3UduWj2dqEtN9yZIq8Dk3HyPI33x9sqqU5C8sr0g==",
+ "hasInstallScript": true,
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/core-js"
+ }
+ },
"node_modules/cose-base": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/cose-base/-/cose-base-1.0.3.tgz",
@@ -3705,6 +3716,11 @@
"url": "https://github.com/sponsors/wooorm"
}
},
+ "node_modules/fflate": {
+ "version": "0.4.8",
+ "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.4.8.tgz",
+ "integrity": "sha512-FJqqoDBR00Mdj9ppamLa/Y7vxm+PRmNWA67N846RvsoYVMKB4q3y/de5PA7gUmRMYK/8CMz2GDZQmCRN1wBcWA=="
+ },
"node_modules/fill-range": {
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
@@ -6564,6 +6580,38 @@
"node": "^10 || ^12 || >=14"
}
},
+ "node_modules/posthog-js": {
+ "version": "1.249.0",
+ "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.249.0.tgz",
+ "integrity": "sha512-qR1PZPBb8Zc57ZYr1NtPbSJ/RHj9Gnr8NDG5bYDspzyol3KL3kwz+pk4K4ZLyjG/Gb2DyrgrEvr3CtSIlfui/w==",
+ "dependencies": {
+ "core-js": "^3.38.1",
+ "fflate": "^0.4.8",
+ "preact": "^10.19.3",
+ "web-vitals": "^4.2.4"
+ },
+ "peerDependencies": {
+ "@rrweb/types": "2.0.0-alpha.17",
+ "rrweb-snapshot": "2.0.0-alpha.17"
+ },
+ "peerDependenciesMeta": {
+ "@rrweb/types": {
+ "optional": true
+ },
+ "rrweb-snapshot": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/preact": {
+ "version": "10.26.8",
+ "resolved": "https://registry.npmjs.org/preact/-/preact-10.26.8.tgz",
+ "integrity": "sha512-1nMfdFjucm5hKvq0IClqZwK4FJkGXhRrQstOQ3P4vp8HxKrJEMFcY6RdBRVTdfQS/UlnX6gfbPuTvaqx/bDoeQ==",
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/preact"
+ }
+ },
"node_modules/property-information": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/property-information/-/property-information-7.1.0.tgz",
@@ -8007,6 +8055,11 @@
"url": "https://github.com/sponsors/wooorm"
}
},
+ "node_modules/web-vitals": {
+ "version": "4.2.4",
+ "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-4.2.4.tgz",
+ "integrity": "sha512-r4DIlprAGwJ7YM11VZp4R884m0Vmgr6EAKe3P+kO0PPj3Unqyvv59rczf6UiGcb9Z8QxZVcqKNwv/g0WNdWwsw=="
+ },
"node_modules/which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
diff --git a/docs/package.json b/docs/package.json
index 2f1548e26..4f613ef44 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -11,6 +11,7 @@
"dependencies": {
"@radix-ui/react-accordion": "1.2.10",
"@radix-ui/react-slider": "1.3.4",
+ "@tailwindcss/postcss": "4.1.6",
"boring-avatars": "1.11.2",
"clsx": "2.1.1",
"country-flag-icons": "1.5.19",
@@ -21,10 +22,10 @@
"next-mdx-remote": "^5.0.0",
"nextra": "^4.2.17",
"nextra-theme-docs": "4.2.17",
+ "posthog-js": "^1.249.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-tweet": "3.2.2",
- "@tailwindcss/postcss": "4.1.6",
"tailwind-merge": "3.3.0",
"tailwindcss": "4.1.6"
},
diff --git a/docs/src/app/layout.jsx b/docs/src/app/layout.jsx
index 06e7a0df1..17ddad48e 100644
--- a/docs/src/app/layout.jsx
+++ b/docs/src/app/layout.jsx
@@ -9,6 +9,7 @@ import { getPageMap } from "nextra/page-map";
import { cn } from "../lib/utils";
import { SmallLogo } from "./components/Logo";
import "./globals.css";
+import { PostHogProvider } from "./providers";
const tilt_wrap = Tilt_Warp({
subsets: ["latin"],
@@ -132,35 +133,41 @@ export default async function RootLayout({ children }) {
defer
></script>
<body>
- <Layout
- banner={
- <div className="text-center text-sm text-neutral-100 pt-2 pb-1 bg-neutral-700/50 flex items-center justify-center gap-2">
- <div className="mb-1">
- πŸš€ We just launched! Please star us on Github!{" "}
+ <PostHogProvider>
+ <Layout
+ banner={
+ <div className="text-center text-sm text-neutral-100 pt-2 pb-1 bg-neutral-700/50 flex items-center justify-center gap-2">
+ <div className="mb-1">
+ πŸš€ We just launched! Please star us on Github!{" "}
+ </div>
+ <a
+ className="github-button"
+ href="https://github.com/rybbit-io/rybbit"
+ data-color-scheme="no-preference: light; light: light; dark: light;"
+ data-show-count="true"
+ aria-label="Star rybbit-io/rybbit on GitHub"
+ ></a>
</div>
- <a
- className="github-button"
- href="https://github.com/rybbit-io/rybbit"
- data-color-scheme="no-preference: light; light: light; dark: light;"
- data-show-count="true"
- aria-label="Star rybbit-io/rybbit on GitHub"
- ></a>
- </div>
- }
- navbar={navbar}
- footer={<Footer_ />}
- editLink="Edit this page on GitHub"
- docsRepositoryBase="https://github.com/rybbit-io/rybbit/tree/master/docs"
- sidebar={{ defaultMenuCollapseLevel: 1 }}
- pageMap={pageMap}
- nextThemes={{
- defaultTheme: "dark",
- forcedTheme: "dark",
- }}
- >
- {children}
- </Layout>
- <script async defer src="https://buttons.github.io/buttons.js"></script>
+ }
+ navbar={navbar}
+ footer={<Footer_ />}
+ editLink="Edit this page on GitHub"
+ docsRepositoryBase="https://github.com/rybbit-io/rybbit/tree/master/docs"
+ sidebar={{ defaultMenuCollapseLevel: 1 }}
+ pageMap={pageMap}
+ nextThemes={{
+ defaultTheme: "dark",
+ forcedTheme: "dark",
+ }}
+ >
+ {children}
+ </Layout>
+ <script
+ async
+ defer
+ src="https://buttons.github.io/buttons.js"
+ ></script>
+ </PostHogProvider>
</body>
</html>
);
diff --git a/docs/src/app/providers.jsx b/docs/src/app/providers.jsx
new file mode 100644
index 000000000..62cafafff
--- /dev/null
+++ b/docs/src/app/providers.jsx
@@ -0,0 +1,16 @@
+"use client";
+
+import posthog from "posthog-js";
+import { PostHogProvider as PHProvider } from "posthog-js/react";
+import { useEffect } from "react";
+
+export function PostHogProvider({ children }) {
+ useEffect(() => {
+ posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY, {
+ api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST,
+ defaults: "2025-05-24",
+ });
+ }, []);
+
+ return <PHProvider client={posthog}>{children}</PHProvider>;
+}
diff --git a/docs/tsconfig.json b/docs/tsconfig.json
index fd46aae06..1bb6a08f0 100644
--- a/docs/tsconfig.json
+++ b/docs/tsconfig.json
@@ -32,7 +32,8 @@
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
- ".next/types/**/*.ts"
+ ".next/types/**/*.ts",
+ "src/app/providers.jsx"
],
"exclude": [
"node_modules"