// ── Feature Flag Client ─────────────────────────────────────── // Thin wrapper over ByteLystPlatformSDK's BLFeatureFlagClient. // Keeps existing call-site API (FeatureFlagService.shared.isEnabled). import Foundation import ByteLystPlatformSDK @MainActor final class FeatureFlagService: ObservableObject { static let shared = FeatureFlagService() @Published private(set) var flags: [String: Bool] = [:] private let flagClient: BLFeatureFlagClient private init() { let config = BLPlatformConfig.fromInfoPlist( productId: "chronomind", defaultBaseURL: "https://api.chronomind.app", bundleId: "com.saravana.chronomind" ) let client = BLPlatformClient(config: config) flagClient = BLFeatureFlagClient(config: config, client: client) } // MARK: - Public API func start(userId: String? = nil) { flagClient.start(userId: userId) } func stop() { flagClient.stop() } func isEnabled(_ key: String) -> Bool { flagClient.isEnabled(key) } }