AppstackSDK Swift package. For installation and
integration guidance, see the Swift SDK guide.
Current stable release: 4.7.1, published 11 September 2026. See the changelog for everything that changed.
AppstackAttributionSdk
The SDK entry point. Reach it throughAppstackAttributionSdk.shared; it has no
public initializer.
configure(apiKey:logLevel:customerUserId:)
customerUserId is ignored on that second call. Use
setCustomerUserId(_:) to set the ID later.
String
required
Your app’s Appstack API key, from the dashboard under app settings.
String?
default:"nil"
Your identifier for the signed-in user, when it is already known at launch.
Deprecated overloads
Deprecated overloads
setCustomerUserId(_:)
configure(); last write wins.
String?
required
Your identifier for the signed-in user. Set it as soon as it is known, and at
least one event has to follow for it to take effect.
sendEvent(event:name:parameters:)
configure() completes: events arriving early
are buffered and flushed once configuration finishes. The buffer is bounded, so
events sent long before configure() may be dropped.
EventType
required
The event to send. Prefer a standard case over
.CUSTOM wherever one fits. See
EventType.String?
default:"nil"
The event name. Required when
event is .CUSTOM; ignored otherwise, since
standard cases carry their own wire name.[String: Any]?
default:"nil"
Event properties. For revenue events send
revenue (or price) and currency.
Matching parameters (email, name, phone_number, date_of_birth, gender)
are encrypted before they are used for attribution matching — on device on
iOS 17+, and server-side on iOS 15–16. See
enhanced app campaigns.getAppstackId()
configure(): the ID is minted on first read if absent, so integrations that read
it at launch (RevenueCat, Superwall) never receive nil because of a race with
configure().
String?
The install’s Appstack ID.
isSdkDisabled()
true before configure() has
run, and whenever remote configuration has switched it off.
Bool
true when the SDK is disabled and no events will be sent.handleUniversalLink(_:options:)
deeplinkId and query parameters directly off the tapped URL, with no network round
trip, because the URL already carries everything attached to the link. Safe to call
before configure().
Requires an absolute HTTPS URL with a host and the standard link path
/{deeplinkId}, on a custom domain provisioned for the app.
This tap is intercepted by the OS, so no click event is recorded server-side. If
you want to count it as re-engagement, call
sendEvent(...) yourself. This method
does not.URL
required
The tapped link. The
NSUserActivity overload extracts this for you, so pass the
activity straight from application(_:continue:restorationHandler:) or
scene(_:continue:).LinkOptions
default:"LinkOptions()"
Optional host filtering. See LinkOptions.
UniversalLinkResult?
The parsed link, or
nil when the activity is not a Universal Link, the URL
structure is unsupported, or the host is not allowed.getAttributionParams()
configure() has not been called, it returns immediately rather than waiting for
a launch that may never come.
[String: Any]?
Attribution parameters, always carrying the reserved
attributionMatchStatusKey. Never nil in practice:
the optional is kept so existing if let and ?? call sites keep compiling.attributionMatchStatusKey
getAttributionParams()
result. It distinguishes an organic install from a skipped match and from a failed
request, rather than all three arriving as an empty result.
deleteUserData()
AppstackASAAttribution
Apple Search Ads attribution, kept separate from the main SDK so apps that do not run Apple Ads never link it.enableAppleAdsAttribution()
disableASAAttributionTracking()
Types
EventType
EventType.ADD_TO_CART.rawValue is "ADD_TO_CART". Where two names are
synonymous, both are provided for compatibility with existing integrations.
INSTALL is tracked by the SDK itself. You do not need to send it.String
The event name as sent over the wire.
[EventType]
Every case, from
CaseIterable.LogLevel
configure(apiKey:logLevel:customerUserId:). Defaults
to .info.
LinkOptions
Set<String>?
default:"nil"
Hosts to accept. A link on any other host returns
nil. nil accepts any host.
This does not verify domain ownership: your app decides what to route.UniversalLinkResult
String?
The Appstack deep link ID, when the URL carries one.
[String: String]
Query parameters parsed off the tapped URL.
URL
The URL that was handled.