mirror of
https://github.com/formbricks/formbricks.git
synced 2026-05-06 19:35:53 -05:00
16 lines
434 B
TypeScript
16 lines
434 B
TypeScript
"use client";
|
|
|
|
import posthog from "posthog-js";
|
|
import type { TPostHogFeatureFlagValue } from "./types";
|
|
|
|
export const getPostHogClientFeatureFlag = (flagKey: string): TPostHogFeatureFlagValue => {
|
|
if (!posthog.__loaded) {
|
|
return false;
|
|
}
|
|
|
|
const featureFlagValue = posthog.getFeatureFlag(flagKey);
|
|
return featureFlagValue ?? false;
|
|
};
|
|
|
|
export type { TPostHogFeatureFlagContext, TPostHogFeatureFlagValue } from "./types";
|