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

# Swift installation

> Add the SPM package, pick your products, and check the host prerequisites.

## Add the package

In Xcode: **File → Add Package Dependencies…** and enter
`https://github.com/clariodesk/clariodesk-swift`.

Or in `Package.swift`:

```swift theme={null}
dependencies: [
  .package(url: "https://github.com/clariodesk/clariodesk-swift", from: "0.1.1"),
],
targets: [
  .target(
    name: "MyApp",
    dependencies: [
      .product(name: "ClarioDesk", package: "clariodesk-swift"),
      // Only if you use the prebuilt screens:
      .product(name: "ClarioDeskUI", package: "clariodesk-swift"),
    ]
  ),
]
```

## The two products

| Product        | What it is                                                                                                                                   |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `ClarioDesk`   | The headless core: the `ClarioDesk` facade, `AsyncStream` reads, device key, realtime, outbox. One third-party dependency (SwiftCentrifuge). |
| `ClarioDeskUI` | The prebuilt SwiftUI screens (`ClarioDeskWidgets`), theme, and strings. Depends on the core.                                                 |

A headless host links only `ClarioDesk` and Swift dead-strips the UI — you
never ship screens you don't present.

## Platform requirements

| Requirement  | Value                                                                                       |
| ------------ | ------------------------------------------------------------------------------------------- |
| iOS          | 16.0+                                                                                       |
| Swift        | Package is Swift 6; consumable from Swift 5.x hosts                                         |
| Hardware key | Secure Enclave (P-256); software fallback where the SEP is unavailable (e.g. the simulator) |

## Host prerequisites

### Keychain

The SDK stores the device id, device-key blob, and offline outbox in the
Keychain. Any code-signed app has this by default — which is every real app.

<Warning>
  An **unsigned** build can't write the Keychain (`errSecMissingEntitlement`,
  OSStatus `-34018`). This only bites ad-hoc/CI builds without a signing
  identity; add a `keychain-access-groups` entitlement there (the package's
  example app shows how).
</Warning>

### Camera usage string

Add `NSCameraUsageDescription` to your `Info.plist` **only** if you use the
prebuilt UI's camera attach affordance:

```xml theme={null}
<key>NSCameraUsageDescription</key>
<string>Take a photo to attach to your support messages.</string>
```

The photo picker (`PhotosPicker`) and the document picker need **no** usage
strings on iOS 16+.

### Push

The standard APNs capability plus a one-line token forward — see the
[push guide](/swift/push). No Firebase.

## Verify

```swift theme={null}
import ClarioDesk

ClarioDesk.initialize(.init(apiKey: "pk_live_…"))
// Fire-and-forget: every subsequent call awaits the shared bootstrap, so
// nothing races. Next, wire identity. See the lifecycle guide.
```

<Card title="Next: lifecycle integration" icon="user-check" href="/swift/lifecycle">
  Wire the four host events that touch the SDK.
</Card>
