> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kontext.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Add the Swift SDK to your iOS project and configure ATT + SKAdNetwork.

> [!NOTE]
>
> You'll need a [publisher account](https://docs.kontext.so/publishers.md#getting-started-is-easy) to obtain your `publisherToken` and placement codes.

## 1. Add the SDK

> [tab] Swift Package Manager
>
> Add the SDK as a package dependency:
>
> ```swift theme={null}
> dependencies: [
>     .package(url: "https://github.com/kontextso/sdk-swift", .upToNextMajor(from: "4.0.0")) // pulls the latest 4.x
> ]
> ```
>
> Then add the `KontextSwiftSDK` product to your target.

> [tab] CocoaPods
>
> Add to your `Podfile`:
>
> ```ruby theme={null}
> pod 'KontextSwiftSDK', '~> 4.0' # pulls the latest 4.x
> ```
>
> Then run `pod install`.

## 2. Set up IDFA (App Tracking Transparency)

Add `NSUserTrackingUsageDescription` to `Info.plist`. The SDK auto-prompts for ATT the first time a session is created and reads IDFA + IDFV from there.

See [IFA & ATT](https://docs.kontext.so/guides/ifa.md) for the full setup — required `Info.plist` key, prompt-timing gotchas, and how to manage the prompt yourself.

## 3. Set up SKAdNetwork

Add Kontext's own ad network identifier — plus the DSP identifiers we provide during onboarding — to `Info.plist`. The SDK reads them at startup and forwards them on every `/init`.

```xml theme={null}
<key>SKAdNetworkItems</key>
<array>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>mp7rpxwdrx.adattributionkit</string>
  </dict>
</array>
```

Without Kontext's identifier, installs from directly-served campaigns silently won't be attributed. See [SKAdNetwork](https://docs.kontext.so/guides/skadnetwork.md) for the full guide.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.