2025-12-17 14:07:22 +09:00
|
|
|
/**
|
|
|
|
|
* Feature Flags Configuration
|
|
|
|
|
*
|
|
|
|
|
* Controls gradual rollout of new features.
|
|
|
|
|
* Initially uses environment variables, can be replaced with a feature flag service.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
export const FEATURE_FLAGS = {
|
|
|
|
|
/**
|
2025-12-25 13:59:28 +09:00
|
|
|
* Enable public services browsing (browse without login)
|
2025-12-17 14:07:22 +09:00
|
|
|
*/
|
2025-12-25 13:59:28 +09:00
|
|
|
PUBLIC_SERVICES: process.env.NEXT_PUBLIC_FEATURE_PUBLIC_SERVICES !== "false",
|
2025-12-17 14:07:22 +09:00
|
|
|
|
|
|
|
|
/**
|
2025-12-23 13:21:29 +09:00
|
|
|
* Enable unified checkout (authenticated checkout flow)
|
2025-12-17 14:07:22 +09:00
|
|
|
*/
|
|
|
|
|
UNIFIED_CHECKOUT: process.env.NEXT_PUBLIC_FEATURE_UNIFIED_CHECKOUT !== "false",
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Enable public support (FAQ and contact without login)
|
|
|
|
|
*/
|
|
|
|
|
PUBLIC_SUPPORT: process.env.NEXT_PUBLIC_FEATURE_PUBLIC_SUPPORT !== "false",
|
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Hook to check if a feature is enabled
|
|
|
|
|
*/
|
|
|
|
|
export function useFeatureFlag(flag: keyof typeof FEATURE_FLAGS): boolean {
|
|
|
|
|
return FEATURE_FLAGS[flag];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Check if a feature is enabled (for use outside React components)
|
|
|
|
|
*/
|
|
|
|
|
export function isFeatureEnabled(flag: keyof typeof FEATURE_FLAGS): boolean {
|
|
|
|
|
return FEATURE_FLAGS[flag];
|
|
|
|
|
}
|