Basic Configuration
Configure SpendOwl once during app launch with your API key:- SwiftUI
- UIKit
What Happens on Configure
When you callconfigure(), SpendOwl automatically:
- Fetches attribution — Gets the Apple Search Ads attribution token and sends it to SpendOwl servers
- Starts purchase tracking — Observes StoreKit 2 transactions for ROAS calculation
- Initializes networking — Sets up the API client with retry logic
Both attribution and purchase tracking are required for accurate ROAS calculation.
Advanced Configuration
For more control, useSpendOwlConfiguration:
Configuration Options
The API base URL. Only change this for testing or if instructed by SpendOwl support.
Network request timeout in seconds. Increase for slow networks.
Maximum retry attempts for failed requests. Client errors (4xx) are not retried.
Check Configuration Status
Verify the SDK is configured before using other methods:API Key Best Practices
Use Environment Variables
Use Environment Variables
Don’t hardcode API keys in source code. Use environment variables or a configuration file:
Separate Keys for Environments
Separate Keys for Environments
Use different API keys for development and production:
Never Commit Keys
Never Commit Keys
Add your config file to
.gitignore to prevent accidentally committing API keys.Thread Safety
SpendOwl is thread-safe. You can callconfigure() from any thread, though calling from the main thread during app launch is recommended.