CupThread React Native & Expo SDK - v0.1.0
    Preparing search index...

    Function isSurfaceEnabled

    • Evaluates whether a given SDK surface is enabled according to remote feature flags.

      Parameters

      • appConfig: PublicAppConfig | null | undefined

        Remote application configuration, or null/undefined.

      • surface: keyof SdkFeatures

        The SDK surface to check ('feedback' | 'featureRequests' | 'roadmap' | 'changelog').

      Returns boolean

      false only if the remote feature flag explicitly disables the surface; otherwise true.

      Safe by default: returns true when appConfig is null or undefined (config not yet loaded or fetch failed) or when sdk.features or the specific flag is undefined (older backend version). Gating activates only on an explicit false.

      if (!isLoadingConfig && !isSurfaceEnabled(appConfig, 'roadmap')) {
      // surface is disabled
      }