Skip to main content

SpendOwlConfiguration

Configuration struct for customizing SDK behavior.

Initializer

Parameters

String
required
Your SpendOwl API key from the dashboard.
URL
default:"https://spendowl.io/api"
The API base URL. Only change for testing or if instructed by support.
TimeInterval
default:"10"
Network request timeout in seconds.
Int
default:"3"
Total attempts per request, including the first — not a retry count. The default of 3 means one request plus two retries. Values below 1 are raised to 1. Client errors (4xx) are not retried.

Properties

apiKey

Your SpendOwl API key.

baseURL

The base URL for API requests. Default: https://spendowl.io/api

timeoutInterval

Network request timeout in seconds. Default: 10
Increase this value if users experience timeout issues on slow networks.

maxRetries

The total number of attempts made for a request, including the first one. Default: 3 — one initial request plus two retries.
Despite the name, this counts attempts rather than retries. maxRetries: 1 means a single try and no retry at all. Values below 1 are raised to 1, since a request count of zero would leave the SDK unable to send anything.
Retry Behavior:
  • Network errors are retried with exponential backoff
  • Server errors (5xx) are retried
  • Client errors (4xx) are not retried

Usage Examples

Basic Configuration

For most apps, use the simple API key initializer:

Custom Timeout

For apps used on slower networks:

Aggressive Retries

For critical attribution tracking — five attempts, so four retries:

Testing Configuration

For integration tests:

Sendable Conformance

SpendOwlConfiguration conforms to Sendable, making it safe to pass across concurrency boundaries:

SpendOwl

Main SDK class

Configuration Guide

Configuration guide