> For the complete documentation index, see [llms.txt](https://docs.keewano.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keewano.com/sdks/ios.md).

# iOS SDK

Install and configure the Keewano SDK in an iOS project.

Add the package, put your API key in `Info.plist`, and make one `initialize` call as early as possible.

**Prerequisites:** a Keewano project API key (a JWT issued in the Keewano console), an app targeting iOS 18 or later, and Xcode with Swift 6.

## 1. Add the dependency

**Swift Package Manager** — in Xcode: **File → Add Package Dependencies…**, enter the repository URL ([github.com/Keewano/keewano-ios-sdk](https://github.com/Keewano/keewano-ios-sdk)), and add the `KeewanoSDK` library to your app target.

**CocoaPods:**

```ruby
pod 'KeewanoSDK', '~> 1.0'
```

The SDK has **no third-party dependencies** and links no frameworks you don't already have — Foundation, UIKit, Network and MetricKit are all part of the system. Its Apple privacy manifest ships with it, so there is nothing to add on your side.

## 2. Configure your API key

Add your key to the app's `Info.plist`:

```xml
<key>KeewanoAPIKey</key>
<string>YOUR_KEEWANO_API_KEY</string>
```

That is the only required setting. Every other option has a safe, fully-featured default.

## 3. Initialize the SDK

Unlike Android, iOS **cannot** start the SDK for you: the platform offers no supported hook that runs library code before your app delegate from a pure-Swift package. So one call is required, as early as possible:

```swift
import KeewanoSDK

func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
    KeewanoSDK.initialize()   // reads KeewanoAPIKey from Info.plist
    return true
}
```

SwiftUI app with no delegate? Call it from your `App`'s initializer:

```swift
@main
struct MyApp: App {
    init() { KeewanoSDK.initialize() }
    var body: some Scene { WindowGroup { RootView() } }
}
```

`initialize` is idempotent, may be called from any thread, and never throws — a failure inside it disables the SDK and logs, rather than propagating into your app.

## 4. Forward deep links

{% hint style="warning" %}
**This is the one automatic event you can silently lose.** Deep links are delivered to *your* app delegate, which the SDK cannot observe without swizzling it — so if you don't forward them, no `DEEP_LINK_ACTIVATED` event is ever reported.
{% endhint %}

See [Getting Started](https://github.com/Keewano/keewano-ios-sdk/blob/main/docs/getting-started.md#4-forward-deep-links) for the forwarding call.

## 5. Report your first event

For events beyond the built-in set, see [Custom Events Codegen](https://docs.keewano.com/sdks/custom-events-codegen.md).

***

## Full documentation

|                                                                                                         |                                               |
| ------------------------------------------------------------------------------------------------------- | --------------------------------------------- |
| [Getting Started](https://github.com/Keewano/keewano-ios-sdk/blob/main/docs/getting-started.md)         | Install, configure, verify                    |
| [Configuration](https://github.com/Keewano/keewano-ios-sdk/blob/main/docs/configuration.md)             | Every `KeewanoConfig` option                  |
| [Automatic Tracking](https://github.com/Keewano/keewano-ios-sdk/blob/main/docs/automatic-tracking.md)   | What is captured with no extra code           |
| [Custom Events](https://github.com/Keewano/keewano-ios-sdk/blob/main/docs/custom-events.md)             | Your own typed events                         |
| [Privacy and Consent](https://github.com/Keewano/keewano-ios-sdk/blob/main/docs/privacy-and-consent.md) | Consent gating, PII, and the privacy manifest |
| [API Reference](https://github.com/Keewano/keewano-ios-sdk/blob/main/docs/api-reference.md)             | Every reporting method                        |

Source: [github.com/Keewano/keewano-ios-sdk](https://github.com/Keewano/keewano-ios-sdk)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.keewano.com/sdks/ios.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
