mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 08:13:56 +10:00
28 lines
695 B
TypeScript
28 lines
695 B
TypeScript
import { env } from '@documenso/lib/utils/env';
|
|
|
|
import { NEXT_PUBLIC_WEBAPP_URL } from './app';
|
|
|
|
const NEXT_PUBLIC_POSTHOG_KEY = () => env('NEXT_PUBLIC_POSTHOG_KEY');
|
|
|
|
/**
|
|
* The flag name for global session recording feature flag.
|
|
*/
|
|
export const FEATURE_FLAG_GLOBAL_SESSION_RECORDING = 'global_session_recording';
|
|
|
|
/**
|
|
* Extract the PostHog configuration from the environment.
|
|
*/
|
|
export function extractPostHogConfig(): { key: string; host: string } | null {
|
|
const postHogKey = NEXT_PUBLIC_POSTHOG_KEY();
|
|
const postHogHost = `${NEXT_PUBLIC_WEBAPP_URL()}/ingest`;
|
|
|
|
if (!postHogKey || !postHogHost) {
|
|
return null;
|
|
}
|
|
|
|
return {
|
|
key: postHogKey,
|
|
host: postHogHost,
|
|
};
|
|
}
|