Skip to main content

Configuration Options

import com.zixflow.sdk.ZixflowConfigBuilder
import com.zixflow.sdk.core.util.ZixflowLogLevel
import com.zixflow.sdk.data.model.Region
import com.zixflow.datapipelines.config.ScreenView

val config = ZixflowConfigBuilder(
    applicationContext = this,
    apiKey = "YOUR_API_KEY"
)
    // Logging
    .logLevel(ZixflowLogLevel.DEBUG)  // NONE, ERROR, INFO, DEBUG

    // Workspace region (default: Region.US)
    .region(Region.US)

    // Auto-tracking
    .autoTrackDeviceAttributes(true)          // default: true
    .autoTrackActivityScreens(false)          // default: false
    .trackApplicationLifecycleEvents(true)    // default: true

    // How screen events are used (default: ScreenView.All)
    .screenViewUse(ScreenView.All)

    // Optional host overrides (override region-based defaults)
    // .apiHost("api-events.zixflow.com/v1")
    // .cdnHost("cdn.example.com")

    // Event batching
    .flushAt(20)          // Send after 20 events (default: 20)
    .flushInterval(30)    // Or every 30 seconds (default: 30)

    .build()

Defaults

OptionDefault
logLevelZixflowLogLevel.ERROR
regionRegion.US
autoTrackDeviceAttributestrue
autoTrackActivityScreensfalse
trackApplicationLifecycleEventstrue
screenViewUseScreenView.All
flushAt20
flushInterval30 (seconds)

Region

Use .region(Region.US) or .region(Region.EU) so CDP requests route to the correct regional endpoint. If you set apiHost or cdnHost manually, those values override region-based defaults.

Screen view use

ValueBehavior
ScreenView.AllScreen events are sent to the backend and used for in-app targeting
ScreenView.InAppScreen events are kept on-device for in-app route matching only

Log Levels

Control SDK logging verbosity:
import com.zixflow.sdk.core.util.ZixflowLogLevel

.logLevel(ZixflowLogLevel.NONE)   // No logs
.logLevel(ZixflowLogLevel.ERROR)  // Errors only (default)
.logLevel(ZixflowLogLevel.INFO)   // Errors + informational
.logLevel(ZixflowLogLevel.DEBUG)  // All messages (development)

Auto-collected device attributes

When autoTrackDeviceAttributes(true) is enabled (the default), the SDK collects:
  • device_os
  • device_model
  • device_manufacturer
  • app_version
  • zixflow_sdk_version
  • device_locale
  • push_enabled
You can still set custom device attributes with Zixflow.instance().setDeviceAttributes(...).