mirror of
https://github.com/documenso/documenso.git
synced 2025-11-10 04:22:32 +10:00
17 lines
390 B
TypeScript
17 lines
390 B
TypeScript
import { PostHog } from 'posthog-node';
|
|
|
|
import { extractPostHogConfig } from '@documenso/lib/constants/feature-flags';
|
|
|
|
export default function PostHogServerClient() {
|
|
const postHogConfig = extractPostHogConfig();
|
|
|
|
if (!postHogConfig) {
|
|
return null;
|
|
}
|
|
|
|
return new PostHog(postHogConfig.key, {
|
|
host: postHogConfig.host,
|
|
fetch: async (...args) => fetch(...args),
|
|
});
|
|
}
|