Skip to content

Commit

Permalink
add posthog
Browse files Browse the repository at this point in the history
  • Loading branch information
konstrybakov committed Aug 19, 2024
1 parent 89f4814 commit fff01bf
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
20 changes: 20 additions & 0 deletions app/providers.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'use client'

import posthog from 'posthog-js'
import { PostHogProvider } from 'posthog-js/react'
import type { PropsWithChildren } from 'react'

if (!process.env.NEXT_PUBLIC_POSTHOG_KEY) {
throw new Error('NEXT_PUBLIC_POSTHOG_KEY env variable is not set')
}

if (typeof window !== 'undefined') {
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY, {
api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST,
person_profiles: 'identified_only',
})
}

export function CSPostHogProvider({ children }: PropsWithChildren) {
return <PostHogProvider client={posthog}>{children}</PostHogProvider>
}
Binary file modified bun.lockb
Binary file not shown.
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@radix-ui/react-toggle-group": "^1.1.0",
"@radix-ui/react-visually-hidden": "^1.1.0",
"@tanstack/react-table": "^8.20.1",
"ai": "^3.3.5",
"ai": "^3.3.11",
"bson": "^6.8.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
Expand All @@ -43,25 +43,26 @@
"next": "14.2.5",
"next-auth": "^5.0.0-beta.20",
"next-themes": "^0.3.0",
"posthog-js": "^1.156.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hotkeys-hook": "^4.5.0",
"server-only": "^0.0.1",
"sonner": "^1.5.0",
"tailwind-merge": "^2.4.0",
"tailwind-merge": "^2.5.2",
"tailwindcss-animate": "^1.0.7",
"title-case": "^4.3.1",
"zod": "^3.23.8"
},
"devDependencies": {
"@biomejs/biome": "^1.8.3",
"@types/bun": "^1.1.6",
"@types/node": "^20.14.15",
"@types/node": "^20.16.1",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"postcss": "^8.4.41",
"prisma": "^5.18.0",
"tailwindcss": "^3.4.9",
"tailwindcss": "^3.4.10",
"typescript": "^5.5.4"
}
}
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
// ---
"noUnusedLocals": true,
"noUnusedParameters": true,
"noPropertyAccessFromIndexSignature": true,
// ---
"esModuleInterop": true,
"resolveJsonModule": true,
Expand Down

0 comments on commit fff01bf

Please sign in to comment.