Files
buzz/instrumentation-client.ts
T
dmgnr c39b7a7a3b
Build and Push Image / build-backend (push) Successful in 1m33s
Build and Push Image / build-frontend (push) Successful in 2m37s
Build and Push Image / push (push) Successful in 1m15s
fix(posthog): use organizational proxy
2026-07-13 01:00:52 +07:00

29 lines
886 B
TypeScript
Executable File

import posthog from "posthog-js";
if (process.env.NODE_ENV === "production")
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN!, {
api_host: "https://s.astrxl.dev",
ui_host: "https://us.posthog.com",
defaults: "2026-01-30",
capture_exceptions: true,
debug: process.env.ENVIRONMENT === "development",
before_send: (event) => {
if (event?.event === "$exception") {
const exceptionList = event.properties.$exception_list || [];
const exception = exceptionList[0];
if (exception) {
if (
exception.$exception_source?.includes("posthog") ||
exception.value?.includes("posthog") ||
exception.value?.includes("__ph_opt_in_out") ||
exception.value === "NEXT_REDIRECT"
) {
return null;
}
}
}
return event;
},
});