// Build-time feature flags shared across Entropy Softworks apps. // // Expo inlines `EXPO_PUBLIC_*` env vars at bundle time, so these resolve to // constants in each app's build. Both default OFF-state when unset: // // EXPO_PUBLIC_DISABLE_BRANDING default false → Entropy branding shown. // Self-hosters may set "true" to strip Entropy logo / boot splash / // "An Entropy Softworks product" byline + entropy-related legal content. // It does NOT touch the product's own logo/branding. SaaS ships "false". // // EXPO_PUBLIC_ENABLE_LICENSING default false → no licensing gate active. // SaaS production ships "true" and a separate app supplies the actual // licensing/subscription integration. Self-hosters leave it off; the gate // wiring is present everywhere either way. // // INVARIANT: licensing requires Entropy branding. Licensing is only ever used // by Entropy's own SaaS deployments, which always carry the company branding // and legal content — so ENABLE_LICENSING is coerced off (with a warning) // whenever DISABLE_BRANDING is set. There is no valid unbranded+licensed // configuration. export const DISABLE_BRANDING = process.env.EXPO_PUBLIC_DISABLE_BRANDING === "true"; const RAW_ENABLE_LICENSING = process.env.EXPO_PUBLIC_ENABLE_LICENSING === "true"; export const ENABLE_LICENSING = RAW_ENABLE_LICENSING && !DISABLE_BRANDING; if (RAW_ENABLE_LICENSING && DISABLE_BRANDING) { console.warn( "[entropy-ui] EXPO_PUBLIC_ENABLE_LICENSING ignored: licensing requires " + "Entropy branding and legal content (EXPO_PUBLIC_DISABLE_BRANDING must " + "be false). Licensing has been disabled for this build." ); } /** True when Entropy company branding should render (the common case). */ export function brandingEnabled(): boolean { return !DISABLE_BRANDING; } /** Licensing flag + (future) status. Hook form for ergonomic consumption. */ export function useLicensing(): { enabled: boolean } { return { enabled: ENABLE_LICENSING }; }