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

# Install Chappie SDK in Your iOS or macOS App

> Add Chappie SDK to your Xcode project via Swift Package Manager in minutes, then import ChappieSDK and optionally link the Runtime product.

Chappie ships as a Swift package with three separate library products so you only link what your app actually needs. The core `ChappieSDK` product covers authentication, the client, harnesses, streaming, and host tools. `ChappieSDKRuntime` adds durable thread storage and is entirely optional. `ChappieSDKTesting` provides seeded auth fixtures for your test targets and should never be linked to an app target. Follow the steps below to add the package to your project.

## Add the Package in Xcode

<Steps>
  <Step title="Open the Add Package Dependencies dialog">
    With your project open in Xcode, go to **File → Add Package Dependencies…**. The package dependency sheet opens and shows your existing packages.
  </Step>

  <Step title="Enter the repository URL">
    Paste the Chappie SDK repository URL into the search bar at the top-right corner of the sheet:

    ```
    https://github.com/b-nnett/chappie-sdk.git
    ```

    Xcode resolves the package and shows the available versions.
  </Step>

  <Step title="Set the version requirement">
    Choose **Up to Next Major Version** as your dependency rule and set the minimum version to `0.1.0`. This lets your project receive patch and minor updates automatically while protecting you from breaking changes.
  </Step>

  <Step title="Add ChappieSDK to your app target">
    In the package product list, select **ChappieSDK** and add it to your app target. This is the only product you need for auth, messaging, and streaming.
  </Step>

  <Step title="Optionally add ChappieSDKRuntime">
    If you want transcripts to survive app launches, also select **ChappieSDKRuntime** and add it to your app target. Skip this product if you only need in-memory conversations.

    <Note>
      `ChappieSDKRuntime` is an optional add-on. Your app compiles and runs without it. Add it only when you need `ChappieFileThreadStore` for persisted thread storage or normalized runtime turn events.
    </Note>
  </Step>

  <Step title="Verify the import">
    Build your target once to confirm the package resolved correctly, then add the import at the top of any Swift file where you plan to use the SDK:

    ```swift theme={null}
    import ChappieSDK
    ```

    If you added `ChappieSDKRuntime`, also import it where you create a thread store:

    ```swift theme={null}
    import ChappieSDKRuntime
    ```
  </Step>
</Steps>

## Add the Package via a Package Manifest

If you manage your project through a `Package.swift` manifest rather than an Xcode project file, declare the dependency in the `dependencies` array and then add the product to your target:

<CodeGroup>
  ```swift Package.swift — dependencies theme={null}
  .package(url: "https://github.com/b-nnett/chappie-sdk.git", from: "0.1.0")
  ```

  ```swift Package.swift — targets theme={null}
  .target(
      name: "MyApp",
      dependencies: [
          .product(name: "ChappieSDK", package: "chappie-sdk")
      ]
  )
  ```
</CodeGroup>

To also include the runtime product, add it to the same target's `dependencies` array:

```swift theme={null}
.product(name: "ChappieSDKRuntime", package: "chappie-sdk")
```

<Note>
  Add `ChappieSDKTesting` only to test targets — never to your app target. It provides seeded auth fixtures for unit and UI tests and is not intended for production use.

  ```swift theme={null}
  .testTarget(
      name: "MyAppTests",
      dependencies: [
          .product(name: "ChappieSDK", package: "chappie-sdk"),
          .product(name: "ChappieSDKTesting", package: "chappie-sdk")
      ]
  )
  ```
</Note>

## Privacy Manifest

The `ChappieSDK` package bundles a `PrivacyInfo.xcprivacy` privacy manifest declaring linked account identifiers and email used for app functionality. No tracking domains are declared. Xcode automatically includes this manifest in your app's privacy report when you archive for distribution, so you do not need to add any privacy declarations manually for the SDK's data use.

<Warning>
  If you use `ChappieFileThreadStore` and your harness or tool responses include sensitive user data, review what gets written to the transcript before persisting it. The file store does not redact content. Provide a custom `ChappieThreadStore` implementation if your app must exclude particular fields from disk.
</Warning>
