Options

View as Markdown

When initializing the SDK for iOS, you have the flexibility to provide various initialization options.

Options

Below are the options that control various aspects of the SDK for iOS.

Option Type Default Description
application Any? nil A reference to your application. Useful in plugins or async code where referring back to the application is necessary.
endpoint String test.example.com/v1 The base endpoint used to construct the event sending and settings retrieval endpoints.
autoAddKrenalisDestination Bool true This automatically adds the Krenalis Destination plugin. The SDK supports also the autoAddSegmentDestination option from the Segment SDK, which can be used as an alternative with the same effect.
defaultSettings Settings? nil The settings object used as fallback in case of network failure. Useful to ensure destinations are enabled immediately on first launch before settings are fetched from the endpoint.
flushAt Int 20 The count of events at which Krenalis flushes events.
flushInterval TimeInterval 30 The interval in seconds at which Krenalis flushes events.
flushPolicies [FlushPolicy] [CountBasedFlushPolicy(), IntervalBasedFlushPolicy()] Add more granular control for when to flush.
storageMode StorageMode .disk The storage mode for events. Available values: .disk, .diskAtURL(URL), .memory(Int), or .custom(DataStore).
trackApplicationLifecycleEvents Boolean true Set to true to automatically track Lifecycle events.
sessionAutoTrack Bool true This automatically tracks the user sessions.
sessionTimeout Int64 5 * 60000 (5 minutes) The interval in milliseconds at which the user session expires.