Skip to main content

Full Configuration Options

final config = ZixflowConfig(
  // Required
  apiKey: 'YOUR_API_KEY',

  // Logging level
  logLevel: LogLevel.debug,  // none, error, info, debug

  // Auto-tracking options
  autoTrackDeviceAttributes: true,
  trackApplicationLifecycleEvents: true,

  // Screen tracking
  screenViewUse: ScreenView.all,  // all, inApp

  // Event batching
  flushAt: 20,          // Send events after 20 tracked
  flushInterval: 30,    // Or every 30 seconds

  // Custom endpoints (advanced)
  apiHost: 'custom-api.example.com',
  cdnHost: 'custom-cdn.example.com',

  // In-app messaging
  inAppConfig: InAppConfig(),

  // Push notifications (Android click behavior)
  pushConfig: PushConfig(
    android: PushConfigAndroid(
      pushClickBehavior: PushClickBehaviorAndroid.activityPreventRestart,
    ),
  ),

  // Location tracking
  locationConfig: LocationConfig(
    trackingMode: LocationTrackingMode.manual,
  ),
);

await Zixflow.initialize(config: config);

Log Levels

Control SDK logging verbosity:
logLevel: LogLevel.none,   // Disable logging
logLevel: LogLevel.error,  // Errors only
logLevel: LogLevel.info,   // Errors + informational
logLevel: LogLevel.debug,  // All messages (development)

Screen Tracking Options

screenViewUse: ScreenView.all,    // Send screen events for analytics and in-app targeting
screenViewUse: ScreenView.inApp,  // Use screen events for in-app targeting only

Push Click Behavior (Android)

pushConfig: PushConfig(
  android: PushConfigAndroid(
    pushClickBehavior: PushClickBehaviorAndroid.resetTaskStack,
    // or: activityPreventRestart (default), activityNoFlags
  ),
),

Location Tracking Modes

locationConfig: LocationConfig(
  trackingMode: LocationTrackingMode.manual,    // App controls capture (default)
  // trackingMode: LocationTrackingMode.onAppStart,
  // trackingMode: LocationTrackingMode.off,
),
See Location Tracking for platform enablement and APIs.