📦️ Update posthog-js (#1204)

This commit is contained in:
Luke Vella 2024-07-13 16:04:28 +01:00 committed by GitHub
parent 55ef43c2e9
commit 849c199cdd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 9 deletions

View file

@ -64,7 +64,7 @@
"next-i18next": "^13.0.3",
"php-serialize": "^4.1.1",
"postcss": "^8.4.31",
"posthog-js": "^1.102.1",
"posthog-js": "^1.147.0",
"posthog-node": "^3.6.0",
"react-big-calendar": "^1.8.1",
"react-hook-form": "^7.42.1",

View file

@ -12,7 +12,7 @@ import { useRouter } from "next/navigation";
import React from "react";
import { useForm } from "react-hook-form";
import useFormPersist from "react-hook-form-persist";
import { useUnmount } from "react-use";
import { useMount, useUnmount } from "react-use";
import { PollSettingsForm } from "@/components/forms/poll-settings";
import { Trans } from "@/components/trans";
@ -62,6 +62,10 @@ export const CreatePoll: React.FunctionComponent = () => {
useUnmount(clear);
useMount(() => {
posthog?.startSessionRecording();
});
const posthog = usePostHog();
const queryClient = trpc.useUtils();
const createPoll = trpc.polls.create.useMutation({

View file

@ -17,6 +17,9 @@ export function PostHogProvider(props: PostHogProviderProps) {
api_host: process.env.NEXT_PUBLIC_POSTHOG_API_HOST,
opt_out_capturing_by_default: false,
capture_pageview: true,
// we use session recordings to offer support and
// improve the product for our pro users
disable_session_recording: true,
persistence: "memory",
capture_pageleave: false,
autocapture: false,