import ZixflowDataPipelines
import ZixflowLocation
let config = SDKConfigBuilder(apiKey: "YOUR_API_KEY")
// Logging (default: .error)
.logLevel(.debug) // .none, .error, .info, .debug
// Region (default: .US) — hosts resolve from region unless overridden
.region(.US)
// Auto-tracking (defaults: true)
.autoTrackDeviceAttributes(true)
.trackApplicationLifecycleEvents(true)
// Screen tracking (default: auto UIKit tracking off)
.autoTrackUIKitScreenViews()
// Where screen events are sent (default: .all)
// .all = analytics + in-app page rules
// .inApp = keep screens on-device for in-app page rules only
.screenViewUse(screenView: .inApp)
// Custom endpoints (advanced)
.apiHost("api-events.zixflow.com/v1")
.cdnHost("custom-cdn.example.com")
// Event batching (defaults: flushAt 20, flushInterval 30 seconds)
.flushAt(20)
.flushInterval(30)
// Deep linking callback
.deepLinkCallback { url in
print("Deep link received: \(url)")
// Handle deep link navigation
return true // Return true if handled; false may open in browser
}
// Location tracking
.addModule(LocationModule(
config: LocationConfig(mode: .onAppStart)
))
.build()
Zixflow.initialize(withConfig: config)