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

# SDK Installation

> Add the Orbit Apple SDK with Swift Package Manager, and what it costs your app

The Orbit SDK is the runtime half of Orbit: it collects what Apple already knows about your app on real devices and sends it to the console, where it is symbolicated, grouped and handed to the agent. One package, one module per surface, zero dependencies.

## Products

| Product        | What it does                                                                     |
| -------------- | -------------------------------------------------------------------------------- |
| `OrbitVitals`  | MetricKit metrics and diagnostics: crashes, hangs, CPU, disk writes, launches    |
| `OrbitCapture` | Structured events, breadcrumbs, screens, taps, network, logs, replay and revenue |
| `Orbit`        | The umbrella, re-exporting both                                                  |

Depend on `Orbit` for everything, or on a single module when you want only one surface in your binary.

## Install with Swift Package Manager

<Steps>
  <Step title="Add the package">
    In Xcode, **File**, then **Add Package Dependencies**, pointed at `https://github.com/Parsaa-Company/Orbit-SDK`.
  </Step>

  <Step title="Pick a product">
    Add `Orbit` to your app target, or `OrbitVitals` or `OrbitCapture` on their own.
  </Step>

  <Step title="Start it once, early">
    Call `Orbit.Vitals.start` and `Orbit.Capture.start` in `application(_:didFinishLaunchingWithOptions:)` or a SwiftUI `App.init`. See [SDK configuration](/orbit/sdk-configuration).
  </Step>
</Steps>

In a `Package.swift`:

```swift theme={null}
dependencies: [
    .package(url: "https://github.com/Parsaa-Company/Orbit-SDK", from: "0.1.0")
],
targets: [
    .target(
        name: "YourApp",
        dependencies: [
            .product(name: "Orbit", package: "Orbit-SDK")
        ]
    )
]
```

## Platforms

| Platform       | Minimum | What arrives                                                                                                          |
| -------------- | ------- | --------------------------------------------------------------------------------------------------------------------- |
| iOS and iPadOS | 15      | Everything                                                                                                            |
| macOS          | 12      | Diagnostics only for vitals (Apple marks the metric payload unavailable there), all of `OrbitCapture`                 |
| visionOS       | 1       | Everything                                                                                                            |
| tvOS           | 15      | `OrbitCapture` only. Apple ships a MetricKit framework with no usable API, so `OrbitVitals` compiles and does nothing |
| watchOS        | 8       | The same                                                                                                              |

A multiplatform app needs no `#if` of its own on any of them.

## Privacy manifests ship with the SDK

Every module carries its own `PrivacyInfo.xcprivacy` at the root of its resource bundle, as Apple requires of a third party SDK. You do not write or copy one for the SDK's own behaviour.

* `NSPrivacyTracking` is `false`, with no tracking domains. The SDK never reads the IDFA and never prompts for App Tracking Transparency.
* `OrbitVitals` declares `CrashData`, `PerformanceData` and `OtherDiagnosticData`, each linked to the app and never to the person.
* `OrbitCapture` declares product interaction and other usage data, plus `UserID` (because `Capture.setUser` exists) and `PurchaseHistory` (because the revenue surface exists). An SDK declares what it can collect, not only what your build happens to use.
* `NSPrivacyAccessedAPITypes` is **empty**, on both. The SDK uses no required reason API: no `UserDefaults`, no file timestamps, no disk space query, no system boot time. The on-disk queue encodes its timestamps and byte counts in the file names precisely so it never has to ask the file system for them.

<Tip>
  Your app still declares its own App Privacy answer. Settings, Analytics in the console generates it from the surfaces you turned on and how you identify a person, with a `PrivacyInfo.xcprivacy` fragment you can copy.
</Tip>

## Binary size

Release `__TEXT + __DATA` of the module objects, which is what lands in a customer's binary. The budget is 1 MiB per module.

| Module         | macOS (host) | iOS (arm64) |
| -------------- | ------------ | ----------- |
| `OrbitPolicy`  | 163,039      | 163,031     |
| `OrbitVitals`  | 152,448      | 155,004     |
| `OrbitCapture` | 694,418      | 702,853     |
| `Orbit`        | 496          | 488         |

What an app actually links, for the three shapes:

| An app that depends on | Module code |
| ---------------------- | ----------- |
| `OrbitVitals` alone    | 315,487     |
| `OrbitCapture` alone   | 857,457     |
| `Orbit` (both)         | 1,010,401   |

`OrbitPolicy` is the capture policy document and the evaluation both surfaces have to agree on. It is not a product and nothing imports it directly, but it is why `OrbitVitals` honours the same targets and the same per-session sampling `OrbitCapture` does, from one implementation rather than two.

## Measured overhead

Measured rather than claimed, over a 5-minute scripted session against the same app with the SDK off. iOS Simulator, iPhone18,1 on Apple M1, 300 seconds per configuration, 60 screens, 300 taps, 200 network calls and 1,000 log lines.

| Configuration            | CPU   | Peak memory | Sent   |
| ------------------------ | ----- | ----------- | ------ |
| SDK off (baseline)       | 0.85% | 21.5 MB     | 0 KB   |
| Defaults                 | 0.93% | 24.5 MB     | 132 KB |
| With replay              | 1.09% | 26.2 MB     | 225 KB |
| With network bodies      | 1.19% | 27.1 MB     | 132 KB |
| With an open live stream | 1.42% | 28.4 MB     | 247 KB |

Against the baseline:

* **Defaults**: +0.08 points of CPU, +3.0 MB of peak memory, 26 KB sent per minute.
* **Replay**: +0.25 points of CPU, +4.7 MB, 45 KB per minute.
* **Bodies**: +0.34 points of CPU, +5.5 MB, 26 KB per minute.
* **Live stream**: +0.57 points of CPU, +6.9 MB, 49 KB per minute.

The ring buffer costs 16.5 microseconds per event to append and compresses about 32 times on disk, so 1,000 events are 199 KB raw and 6.2 KB stored. A device recording ten events a second spends roughly 0.017% of one core on the buffer.

<Note>
  The CPU column is the whole process, so the scripted session's own work is most of it. What the SDK costs is the difference between the rows, and a CI job fails the build if that difference moves past 5 points.
</Note>

## Next

<CardGroup cols={2}>
  <Card title="SDK configuration" icon="sliders" href="/orbit/sdk-configuration">
    Every field of `CaptureConfiguration` and `VitalsConfiguration`, and where the key comes from.
  </Card>

  <Card title="What the SDK collects" icon="list-check" href="/orbit/what-the-sdk-collects">
    Automatic, explicit, and what never leaves the device.
  </Card>
</CardGroup>
