SpendOwl
The main entry point for the SpendOwl SDK. All methods are static—you don’t need to create an instance.Configuration Methods
configure(apiKey:)
Configures the SDK with your API key.Call this once during app launch. Subsequent calls are ignored.
configure(_:)
Configures the SDK with custom options.Configuration options including API key, timeout, and retry settings.
Attribution Methods
attribution() async throws
Fetches attribution data asynchronously.AttributionResult containing campaign, ad group, and keyword data.
Throws: SpendOwlError if attribution fails.
Example:
attribution(completion:)
Fetches attribution data using a completion handler.Called with the attribution result. May be called on any queue.
User Identity Methods
setUserId(_:)
Sets the user ID for attribution and purchase tracking.Your internal user identifier (e.g., database ID, UUID).
The user ID is included with all subsequent attribution and purchase events.
clearUserId()
Clears the current user ID.Properties
enableLogging
Enables or disables debug logging.false
Example:
logLevel
The current log level for granular control.| Level | Description |
|---|---|
.none | No logging (default) |
.error | Only errors |
.info | Errors and important events |
.debug | All messages including debug info |
isConfigured
Returnstrue if the SDK is configured and ready.
sdkVersion
The current SDK version string.Platform Availability
Thread Safety
TheSpendOwl class is thread-safe (Sendable). All methods can be called from any thread.