Skip to content

Commit

Permalink
Remove posthog (#69)
Browse files Browse the repository at this point in the history
* Remove posthog

* Fix lint errors

* Add back missing code
  • Loading branch information
dboreham authored Dec 21, 2024
1 parent e1e6bc9 commit 23f1299
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 41 deletions.
10 changes: 0 additions & 10 deletions web-app/package-lock.json

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

1 change: 0 additions & 1 deletion web-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"graphql": "^16.8.2",
"graphql-ws": "^5.16.0",
"lodash": "^4.17.21",
"posthog-js": "^1.139.2",
"prismjs": "^1.29.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
31 changes: 1 addition & 30 deletions web-app/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,40 +1,11 @@
// import React from "react";

import { PropsWithChildren } from 'react';
import ReactDOM from 'react-dom/client';
import posthog from 'posthog-js';
import { PostHogProvider } from 'posthog-js/react';

import App from './modules/core/App';

import './index.css';

const VITE_POSTHOG_KEY = 'phc_hPZOabiIQet1rsxRGAELYmKy8eByxgklujcj3rTz4cd';
const VITE_POSTHOG_HOST = 'https://eu.posthog.com';

const PostHogProviderWrapper = ({ children }: PropsWithChildren) => {
if (window.location.host === '0l.fyi') {
posthog.init(VITE_POSTHOG_KEY, {
api_host: VITE_POSTHOG_HOST,
});

return (
<PostHogProvider
apiKey={VITE_POSTHOG_KEY}
options={{ api_host: VITE_POSTHOG_HOST }}
client={posthog}
>
{children}
</PostHogProvider>
);
}
return <>{children}</>;
};

ReactDOM.createRoot(document.getElementById('root')!).render(
// <React.StrictMode>
<PostHogProviderWrapper>
<App />
</PostHogProviderWrapper>,
// </React.StrictMode>
<App />
);

0 comments on commit 23f1299

Please sign in to comment.