mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-11 00:05:36 +02:00
🐜 fix(www): Fix posthog
This commit is contained in:
@@ -53,6 +53,7 @@
|
||||
"eslint": "8.57.0",
|
||||
"eslint-plugin-qwik": "^1.8.0",
|
||||
"howler": "^2.2.4",
|
||||
"posthog-js": "^1.207.0",
|
||||
"prettier": "3.3.3",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import Nestri from "@nestri/sdk";
|
||||
import { NavProgress } from "@nestri/ui";
|
||||
import { component$, Slot } from "@builder.io/qwik";
|
||||
import { component$, Slot, useVisibleTask$ } from "@builder.io/qwik";
|
||||
import { type DocumentHead, type RequestHandler } from "@builder.io/qwik-city";
|
||||
import posthog from "posthog-js";
|
||||
|
||||
export const onGet: RequestHandler = async ({ cacheControl }) => {
|
||||
// Control caching for this request for best performance and to reduce hosting costs:
|
||||
@@ -30,6 +31,10 @@ export const onRequest: RequestHandler = async ({ cookie, sharedMap }) => {
|
||||
}
|
||||
|
||||
export default component$(() => {
|
||||
// eslint-disable-next-line qwik/no-use-visible-task
|
||||
useVisibleTask$(() => {
|
||||
posthog.init('phc_EN9hs9bPxPrTn6224XjPG55t7w9Rh9lMBacDSEHiZjP', { api_host: 'https://app.posthog.com' })
|
||||
})
|
||||
return (
|
||||
<>
|
||||
<NavProgress />
|
||||
|
||||
Reference in New Issue
Block a user