11//
2- // DVCOptions .swift
2+ // DevCycleOptions .swift
33// DevCycle
44//
5- //
65
76import Foundation
87
@@ -16,6 +15,7 @@ public class DevCycleOptions {
1615 var disableRealtimeUpdates : Bool = false
1716 var disableAutomaticEventLogging : Bool = false
1817 var disableCustomEventLogging : Bool = false
18+ var apiProxyURL : String ?
1919
2020 public class OptionsBuilder {
2121 var options : DevCycleOptions
@@ -24,6 +24,7 @@ public class DevCycleOptions {
2424 self . options = DevCycleOptions ( )
2525 }
2626
27+ // Controls the interval between flushing events to the DevCycle servers in milliseconds, defaults to 10 seconds.
2728 public func flushEventsIntervalMs( _ interval: Int ? = 10000 ) -> OptionsBuilder {
2829 self . options. flushEventsIntervalMs = interval
2930 return self
@@ -35,41 +36,54 @@ public class DevCycleOptions {
3536 return self
3637 }
3738
39+ // Disables logging of SDK generated events (e.g. variableEvaluated, variableDefaulted) to DevCycle.
3840 public func disableAutomaticEventLogging( _ disable: Bool ) -> OptionsBuilder {
3941 self . options. disableAutomaticEventLogging = disable
4042 return self
4143 }
4244
45+ // Disables logging of custom events generated by calling .track() method to DevCycle.
4346 public func disableCustomEventLogging( _ disable: Bool ) -> OptionsBuilder {
4447 self . options. disableCustomEventLogging = disable
4548 return self
4649 }
4750
51+ // Controls the log level of the SDK, defaults to `error`
4852 public func logLevel( _ level: LogLevel ) -> OptionsBuilder {
4953 self . options. logLevel = level
5054 return self
5155 }
5256
57+ // Enables the usage of EdgeDB for DevCycle that syncs User Data to DevCycle.
5358 public func enableEdgeDB( _ enable: Bool ) -> OptionsBuilder {
5459 self . options. enableEdgeDB = enable
5560 return self
5661 }
5762
63+ // Disable the use of cached configs
5864 public func disableConfigCache( _ disable: Bool ) -> OptionsBuilder {
5965 self . options. disableConfigCache = disable
6066 return self
6167 }
6268
69+ // The maximum allowed age of a cached config in milliseconds, defaults to 7 days
6370 public func configCacheTTL( _ ttl: Int = 604800000 ) -> OptionsBuilder {
6471 self . options. configCacheTTL = ttl
6572 return self
6673 }
6774
75+ // Disable Realtime Update and their SSE connection.
6876 public func disableRealtimeUpdates( _ disable: Bool ) -> OptionsBuilder {
6977 self . options. disableRealtimeUpdates = disable
7078 return self
7179 }
7280
81+ // Allows the SDK to communicate with a proxy of DevCycle APIs.
82+ public func apiProxyURL( _ proxyURL: String ) -> OptionsBuilder {
83+ self . options. apiProxyURL = proxyURL
84+ return self
85+ }
86+
7387 public func build( ) -> DevCycleOptions {
7488 let result = self . options
7589 self . options = DevCycleOptions ( )
0 commit comments