mirror of
https://github.com/jnsahaj/tweakcn.git
synced 2026-08-28 23:02:07 +08:00
14 lines
379 B
TypeScript
14 lines
379 B
TypeScript
import posthog from "posthog-js";
|
|
|
|
export function initPostHog() {
|
|
if (process.env.NODE_ENV === "development") return;
|
|
const posthogKey = process.env.NEXT_PUBLIC_POSTHOG_KEY;
|
|
if (posthogKey) {
|
|
posthog.init(posthogKey, {
|
|
api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST,
|
|
});
|
|
} else {
|
|
console.warn("PostHog key is missing, skipping initialization.");
|
|
}
|
|
}
|