let config = SDKConfigBuilder(apiKey: "YOUR_API_KEY")
// Logging: Set log level for debugging
.logLevel(.debug) // .error, .info, .debug
// Auto-tracking: Automatically track device info
.autoTrackDeviceAttributes(true)
// Lifecycle events: Track app open, close, etc.
.trackApplicationLifecycleEvents(true)
// Screen tracking: Auto-track UIKit screen views
.autoTrackUIKitScreenViews()
// Screen view configuration
.screenViewUse(screenView: .InApp) // or .all
// Custom endpoints (advanced)
.apiHost("dev-events.zixflow.in")
.cdnHost("custom-cdn.example.com")
// Event batching
.flushAt(20) // Send events after 20 tracked
.flushInterval(30) // Or every 30 seconds
// Deep linking callback
.deepLinkCallback { url in
print("Deep link received: \(url)")
// Handle deep link navigation
return true // Return true if handled
}
// Location tracking
.addModule(LocationModule(
config: LocationConfig(mode: .onAppStart)
))
.build()