@farmart-tech/brave-client-sdk
    Preparing search index...

    Interface FeatureConfig

    Manages maintenance window configurations and provides evaluation logic for downtimes.

    const config = new FeatureConfig('my-feature', remoteConfig);
    if (config.getIsInMaintenance()) {
    showMaintenancePage();
    }
    interface FeatureConfig {
        featureName: string;
        getActiveRelease(): FeatureReleasePlan | null;
        getAllReleases(): FeatureReleasePlan[];
        getConfigs(): FeatureRemoteConfig;
        getCurrentVersion(): string | null;
        getIsGlobal(): boolean;
        getIsInMaintenance(scope?: string, strategy?: MaintenanceStrategy): boolean;
        getNextActiveRelease(): FeatureReleasePlan | null;
    }
    Index

    Properties

    featureName: string

    Methods

    • Finds the currently active release plan based on current time.

      Returns FeatureReleasePlan | null

      The active release plan, or null if no downtime is currently active

      const currentDowntime = config.getActiveRelease();
      if (currentDowntime) {
      console.log(`Downtime ends at: ${currentDowntime.downtimeEndAt}`);
      }
    • Retrieves all planned release configurations.

      Returns FeatureReleasePlan[]

      Array of release plans

    • Retrieves the current version string from configuration.

      Returns string | null

      The version string, or null if not set

    • Internal

      Checks if the configuration data came from the global workspace.

      Returns boolean

      True if global fallback data

    • Determines if the feature is currently in a maintenance window for the given scope.

      Parameters

      • Optionalscope: string

        The application scope to check (e.g., 'web', 'ios', or '*' for any)

      • Optionalstrategy: MaintenanceStrategy

        Maintenance strategy to apply ('auto', 'always', or 'none')

      Returns boolean

      True if currently in maintenance

      const isMaintenance = config.getIsInMaintenance('ios', 'auto');
      
    • Finds the next scheduled release plan in the future.

      Returns FeatureReleasePlan | null

      The next upcoming release plan, or null if none are scheduled

      const nextDowntime = config.getNextActiveRelease();
      if (nextDowntime) {
      notifyUsers(`Planned maintenance on ${nextDowntime.downtimeStartAt}`);
      }