OpenCDPConfig class

Main configuration class for Open CDP SDK

Constructors

OpenCDPConfig({required String cdpApiKey, String? iOSAppGroup, String? cdpEndpoint, bool sendToCustomerIo = false, CustomerIoConfig? customerIo, bool debug = false, bool autoTrackDeviceAttributes = true, bool autoTrackScreens = false, bool trackApplicationLifecycleEvents = true, ScreenView screenViewUse = ScreenView.all, bool enableInAppMessages = false, bool enableInAppRealtime = true, Duration inAppPollInterval = const Duration(seconds: 30), Duration inAppRealtimeStaleTimeout = const Duration(seconds: 60), Duration inAppRealtimeMaxBackoff = const Duration(seconds: 30), int inAppSyncLimit = 10, String? inAppPlatformOverride, String? inAppAppVersionOverride, bool throwErrorsBack = false})
const

Properties

appGroup String?
App Group ID (used for background push notification tracking) Returns iOSAppGroup on iOS, or a default value on Android
no setter
autoTrackDeviceAttributes bool
Whether to automatically track device attributes
final
autoTrackScreens bool
Whether to automatically track screens
final
baseUrl String
Base URL for API endpoints
no setter
cdpApiKey String
CDP API Key
final
cdpEndpoint String?
Optional custom CDP endpoint
final
customerIo CustomerIoConfig?
Customer.io configuration
final
debug bool
Whether to enable debug logging
final
enableInAppMessages bool
Whether the SDK should automatically fetch in-app messages. When true, a CDPInAppManager is created and started during initialize. The manager prefers a server-pushed SSE stream and only polls when the stream is unavailable (see enableInAppRealtime).
final
enableInAppRealtime bool
Whether the SDK should open a Server-Sent Events stream to the backend for low-latency in-app delivery. Only takes effect when enableInAppMessages is also true.
final
hashCode int
The hash code for this object.
no setterinherited
inAppAppVersionOverride String?
Optional override for the app version string sent to the backend. If omitted, the SDK leaves it blank.
final
inAppPlatformOverride String?
Optional override for the platform value sent to the backend. Defaults to ios/android/web based on the runtime.
final
inAppPollInterval Duration
Polling cadence used when realtime is disabled or while the realtime stream is currently disconnected. Defaults to 30 seconds.
final
inAppRealtimeMaxBackoff Duration
Upper bound on exponential-backoff reconnect attempts for the realtime stream. Defaults to 30 seconds (pairs well with full-jitter so peak reconnects after a backend restart stay under a minute even with many concurrent clients).
final
inAppRealtimeStaleTimeout Duration
Maximum quiet period (no bytes — neither events nor heartbeats) tolerated on a "connected" SSE stream before the SDK assumes the stream is dead, tears it down, and reconnects. Defaults to 60 seconds.
final
inAppSyncLimit int
Maximum messages requested per sync (1..50). Defaults to 10.
final
iOSAppGroup String?
iOS App Group(required for push notification tracking on iOS) If not provided, background push tracking may fail for iOS.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
screenViewUse ScreenView
Screen view tracking configuration
final
sendToCustomerIo bool
Whether to send events to Customer.io
final
throwErrorsBack bool
Whether to throw errors back to the caller for handling.
final
trackApplicationLifecycleEvents bool
Whether to track application lifecycle events
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited