ObslyConfig.withDefaults constructor

ObslyConfig.withDefaults({
  1. bool? enableScreenshotOnUi,
  2. List<String>? requestBlacklist,
  3. List<RequestBodyConfig>? requestBodyWhitelist,
  4. List<RequestHeadersConfig>? requestHeadersWhitelist,
  5. TagsBlacklistConfig? tagsBlacklist,
  6. RageClickConfig? rageClick,
  7. AnonymizationConfig? anonymization,
  8. bool? enableCrashes,
  9. bool? enableLifeCycleLog,
  10. bool? enableRequestLog,
  11. bool? enableTagger,
  12. bool? enablePerformance,
  13. bool? enableMetrics,
  14. bool? enableUI,
  15. bool? automaticViewDetection,
  16. int? sessionMaxLengthMins,
  17. int? bufferSize,
  18. bool? captureConsole,
  19. bool? captureBodyOnError,
  20. int? messengerInterval,
  21. bool? enableDebugTools,
  22. bool? enableRules,
  23. ObslyTools? obslyTools,
  24. RateLimitsConfig? rateLimits,
  25. bool? enableRateLimit,
})

Creates a config with all default values applied This ensures consistent defaults throughout the SDK

Implementation

factory ObslyConfig.withDefaults({
  bool? enableScreenshotOnUi,
  List<String>? requestBlacklist,
  List<RequestBodyConfig>? requestBodyWhitelist,
  List<RequestHeadersConfig>? requestHeadersWhitelist,
  TagsBlacklistConfig? tagsBlacklist,
  RageClickConfig? rageClick,
  AnonymizationConfig? anonymization,
  bool? enableCrashes,
  bool? enableLifeCycleLog,
  bool? enableRequestLog,
  bool? enableTagger,
  bool? enablePerformance,
  bool? enableMetrics,
  bool? enableUI,
  bool? automaticViewDetection,
  int? sessionMaxLengthMins,
  int? bufferSize,
  bool? captureConsole,
  bool? captureBodyOnError,
  int? messengerInterval,
  bool? enableDebugTools,
  bool? enableRules,
  ObslyTools? obslyTools,
  RateLimitsConfig? rateLimits,
  bool? enableRateLimit,
}) {
  return ObslyConfig(
    enableScreenshotOnUi: enableScreenshotOnUi ?? DefaultConfiguration.enableScreenshotOnUi,
    requestBlacklist: requestBlacklist,
    requestBodyWhitelist: requestBodyWhitelist,
    requestHeadersWhitelist: requestHeadersWhitelist,
    tagsBlacklist: tagsBlacklist,
    rageClick: rageClick ??
        const RageClickConfig(
          active: DefaultConfiguration.rageClickActive,
          screenshot: DefaultConfiguration.rageClickScreenshot,
          screenshotPercent: DefaultConfiguration.rageClickScreenshotPercent,
        ),
    anonymization: anonymization ?? _getDefaultAnonymizationConfig(),
    enableCrashes: enableCrashes ?? DefaultConfiguration.enableCrashes,
    enableLifeCycleLog: enableLifeCycleLog ?? DefaultConfiguration.enableLifeCycleLog,
    enableRequestLog: enableRequestLog ?? DefaultConfiguration.enableRequestLog,
    enableTagger: enableTagger ?? DefaultConfiguration.enableTagger,
    enablePerformance: enablePerformance ?? DefaultConfiguration.enablePerformance,
    enableMetrics: enableMetrics ?? DefaultConfiguration.enableMetrics,
    enableUI: enableUI ?? DefaultConfiguration.enableUI,
    automaticViewDetection: automaticViewDetection ?? DefaultConfiguration.automaticViewDetection,
    sessionMaxLengthMins: _validateSessionLength(
      sessionMaxLengthMins ?? DefaultConfiguration.sessionMaxLengthMins,
    ),
    bufferSize: _validateBufferSize(bufferSize),
    captureConsole: captureConsole ?? DefaultConfiguration.captureConsole,
    captureBodyOnError: captureBodyOnError ?? DefaultConfiguration.captureBodyOnError,
    messengerInterval: _validateMessengerInterval(
      messengerInterval ?? DefaultConfiguration.messengerInterval,
    ),
    enableDebugTools: enableDebugTools ?? DefaultConfiguration.enableDebugTools,
    enableRules: enableRules ?? DefaultConfiguration.enableRules,
    obslyTools: obslyTools,
    rateLimits: rateLimits,
    enableRateLimit: enableRateLimit ?? DefaultConfiguration.enableRateLimit,
  );
}