Skip to content

Commit

Permalink
Remove posthog
Browse files Browse the repository at this point in the history
  • Loading branch information
cdedreuille committed Jul 15, 2024
1 parent eca4079 commit fb48298
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 37 deletions.
8 changes: 0 additions & 8 deletions apps/addon-catalog/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ export default async function RootLayout({

return (
<html lang="en">
<head>
<script
defer
data-domain="storybook.js.org"
data-api="/api/event"
src="/js/script.js"
></script>
</head>
<body
className={cn(
'min-h-screen bg-white font-sans antialiased dark:bg-slate-950',
Expand Down
14 changes: 3 additions & 11 deletions apps/addon-catalog/app/providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,16 @@

import { ThemeProvider } from 'next-themes';
import type { FC, ReactNode } from 'react';
import posthog from 'posthog-js';
import { PostHogProvider } from 'posthog-js/react';
import PlausibleProvider from 'next-plausible';

interface ProvidersProps {
children: ReactNode;
}

if (typeof window !== 'undefined') {
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY || '', {
api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST,
person_profiles: 'always', // or 'always' to create profiles for anonymous users as well
});
}

export const Providers: FC<ProvidersProps> = ({ children }) => {
return (
<PostHogProvider client={posthog}>
<PlausibleProvider domain="storybook.js.org">
<ThemeProvider attribute="class">{children}</ThemeProvider>
</PostHogProvider>
</PlausibleProvider>
);
};
6 changes: 4 additions & 2 deletions apps/addon-catalog/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
import { withPlausibleProxy } from 'next-plausible';

const nextConfig = withPlausibleProxy()({
basePath: '/addons',
images: {
remotePatterns: [
Expand Down Expand Up @@ -30,6 +32,6 @@ const nextConfig = {
},
];
},
};
});

export default nextConfig;
1 change: 0 additions & 1 deletion apps/addon-catalog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"graphql-request": "^7.1.0",
"human-format": "^1.2.0",
"next": "^14.2.4",
"posthog-js": "^1.141.0",
"prismjs": "^1.29.0",
"react": "^18",
"react-dom": "^18",
Expand Down
13 changes: 1 addition & 12 deletions apps/frontpage/app/providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,16 @@

import { ThemeProvider } from 'next-themes';
import type { FC, ReactNode } from 'react';
import posthog from 'posthog-js';
import { PostHogProvider } from 'posthog-js/react';
import PlausibleProvider from 'next-plausible';

interface ProvidersProps {
children: ReactNode;
}

if (typeof window !== 'undefined') {
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY || '', {
api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST,
person_profiles: 'always', // or 'always' to create profiles for anonymous users as well
});
}

export const Providers: FC<ProvidersProps> = ({ children }) => {
return (
<PlausibleProvider domain="storybook.js.org">
<PostHogProvider client={posthog}>
<ThemeProvider attribute="class">{children}</ThemeProvider>
</PostHogProvider>
<ThemeProvider attribute="class">{children}</ThemeProvider>
</PlausibleProvider>
);
};
1 change: 0 additions & 1 deletion apps/frontpage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"next-plausible": "^3.12.0",
"next-themes": "^0.3.0",
"node-fetch": "^3.3.2",
"posthog-js": "^1.141.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-lite-youtube-embed": "^2.4.0",
Expand Down
2 changes: 0 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fb48298

Please sign in to comment.