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

# Installation

> Add the FlowPilot iOS SDK to your app with Swift Package Manager.

Add FlowPilot to your app with Swift Package Manager (SPM). The package product is named `FlowPilotSDK`, and its one dependency (`lottie-ios`) is pulled in automatically.

<Info>
  The SDK is open source and published at [`github.com/flowpilothq/flowpilot-ios-sdk`](https://github.com/flowpilothq/flowpilot-ios-sdk). Add it straight from that URL with Swift Package Manager. The local-path method below is for contributors or anyone who wants to vendor a checkout.
</Info>

## Requirements

**Requirements**

* iOS 15.0+ / macOS 12.0+
* Swift 5.9+ and Xcode 15.0+
* One transitive dependency: [`lottie-ios`](https://github.com/airbnb/lottie-ios) (4.5.0 and up), pulled in automatically by Swift Package Manager

## Add the package

<Tabs>
  <Tab title="Git URL (Xcode)">
    <Steps>
      <Step title="Open the package dialog">
        In Xcode, go to **File -> Add Package Dependencies**.
      </Step>

      <Step title="Enter the repository URL">
        Paste the FlowPilot iOS SDK repository URL, then choose a version rule (for example, **Up to Next Major Version** from `1.0.0`).

        ```
        https://github.com/flowpilothq/flowpilot-ios-sdk.git
        ```
      </Step>

      <Step title="Add the product to your target">
        Select the **FlowPilotSDK** library product and add it to your app target. Xcode resolves the transitive `lottie-ios` dependency for you.
      </Step>
    </Steps>

    The equivalent `Package.swift` entry:

    ```swift theme={null}
    dependencies: [
        .package(url: "https://github.com/flowpilothq/flowpilot-ios-sdk.git", from: "1.0.0")
    ],
    targets: [
        .target(
            name: "MyApp",
            dependencies: [
                .product(name: "FlowPilotSDK", package: "flowpilot-ios-sdk")
            ]
        )
    ]
    ```
  </Tab>

  <Tab title="Local path">
    If you want to vendor or modify the SDK, clone it next to your app and add it as a local package:

    ```bash theme={null}
    git clone https://github.com/flowpilothq/flowpilot-ios-sdk.git
    ```

    <Steps>
      <Step title="Add a local package in Xcode">
        Go to **File -> Add Package Dependencies -> Add Local...** and select the cloned `flowpilot-ios-sdk` directory.
      </Step>

      <Step title="Add the product to your target">
        Add the **FlowPilotSDK** library product to your app target.
      </Step>
    </Steps>

    The equivalent `Package.swift` entry:

    ```swift theme={null}
    dependencies: [
        .package(path: "../flowpilot-ios-sdk")
    ],
    targets: [
        .target(
            name: "MyApp",
            dependencies: [
                .product(name: "FlowPilotSDK", package: "flowpilot-ios-sdk")
            ]
        )
    ]
    ```
  </Tab>
</Tabs>

## Import the SDK

Once the package is added, import it where you use it:

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

## Notes

* **Deployment target.** The SDK requires a minimum deployment target of **iOS 15.0** (and macOS 12.0). If your app targets an older OS, raise the minimum, or FlowPilot will not link.
* **Lottie comes for free.** You do not add `lottie-ios` yourself. SPM resolves it as a transitive dependency of `FlowPilotSDK`.
* **`flowpilot-export` is not linked into your app.** The package also ships a build-time executable (`flowpilot-export`) that snapshots a flow into an offline bundle. It is run with `swift run`, not added to your app target. See [Offline and bundled flows](/ios-sdk/offline-bundled-flows).

## Common mistakes

* **Adding the wrong product to your target.** The library product is `FlowPilotSDK`. If you reference `flowpilot-export` (the CLI) or a misspelled name, the build fails.
* **Deployment target below the SDK minimum.** A target below iOS 15.0 will not resolve the package. Raise the app's minimum deployment version.
* **Adding `lottie-ios` separately.** It is a transitive dependency. Adding it again by hand can cause duplicate-package conflicts.

## Troubleshooting

* **"Missing package product 'FlowPilotSDK'".** Confirm you selected the `FlowPilotSDK` library product for your target, and that the package resolved without errors (File -> Packages -> Resolve Package Versions).
* **Package fails to resolve from a Git URL.** Confirm the URL is exactly `https://github.com/flowpilothq/flowpilot-ios-sdk.git` and that your machine can reach GitHub. From a corporate network, check that GitHub is not blocked, or clone the repo and use the local-path method instead.

## Related pages

* [Configuration](/ios-sdk/configuration)
* [iOS quickstart](/ios-sdk/quickstart)
* [Offline and bundled flows](/ios-sdk/offline-bundled-flows)
* [iOS SDK overview](/ios-sdk/index)
