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

# Getting started

> Install the Uplink Connectors iOS SDK and connect your first account

The Connectors iOS SDK lets your iOS app connect end users to their accounts — Progressive, Strava, Gusto, and every other connector in the Uplink catalog — and pull their data back into your app.

It ships two products:

* **`UplinkUI`** — `UplinkClient`, the catalog, connections, invocations, and their models. No UI.
* **`UplinkConnect`** — the prebuilt connect flow: consent screen, sign-in sheet, and progress. It runs the connector's automation on the device for you.

> [!NOTE]
>
> `UplinkConnect` drives the [Native iOS SDK](https://docs.uplink.build/api-reference/ios.md) (`Uplink`) under the hood, so you don't need to call it yourself. Use the native SDK directly only if you build your own sign-in flow; see [Invoking connector actions](https://docs.uplink.build/connectors-ios/invoking-actions.md#build-your-own-flow).

## Requirements

* iOS 17 or later
* Xcode 16 or later
* A backend endpoint that returns an Uplink user token for the signed-in user (see [User tokens](https://docs.uplink.build/connectors-ios/invoking-actions.md#user-tokens))

## Installation

The SDK is distributed via Swift Package Manager.

**1. Add the package**

In Xcode, go to **File → Add Package Dependencies…** and enter:

```
https://github.com/uplink-code/uplink-ui-ios
```

**2. Select both products**

Add `UplinkUI` and `UplinkConnect` to your app target. `UplinkConnect` brings in the native `Uplink` SDK.

**3. Import the modules**

```swift theme={null}
import UplinkUI
import UplinkConnect
```

If you manage dependencies with a `Package.swift` file:

```swift theme={null}
dependencies: [
    .package(url: "https://github.com/uplink-code/uplink-ui-ios", from: "0.4.0")
],
targets: [
    .target(
        name: "YourApp",
        dependencies: [
            .product(name: "UplinkUI", package: "uplink-ui-ios"),
            .product(name: "UplinkConnect", package: "uplink-ui-ios")
        ]
    )
]
```

## Configure `UplinkClient`

`UplinkClient` is the entry point. Create it once at app startup and reuse it.

```swift theme={null}
import UplinkUI

let client = UplinkClient(config: .init(
    userTokenProvider: { try await MyBackend.shared.uplinkUserToken() }
))
```

**Config parameters:**

* `userTokenProvider` — an async closure that returns a fresh Uplink user token for the signed-in user, fetched from your own backend. The SDK caches it until shortly before it expires and calls the closure again after a 401. See [User tokens](https://docs.uplink.build/connectors-ios/invoking-actions.md#user-tokens).
* `connectorsURL` — the Uplink Connectors service the SDK calls. Defaults to `https://connectors.uplink.build`.

## Connect an account

`UplinkConnect.present` shows the consent screen and the connector's sign-in in a sheet, runs the first action, and returns once the user taps Done:

```swift theme={null}
import UIKit
import UplinkConnect
import UplinkUI

@MainActor
func connectProgressive(from viewController: UIViewController) async throws {
    let result = try await UplinkConnect.present(
        from: viewController,
        client: client,
        connectorId: "@atomic/progressive",
        grantedActions: ["fetchAll"],
        runAction: "fetchAll",
        consumingAppName: "MyApp"
    )

    // Save this to refresh the connection later.
    print(result.connectionId)

    // The action's output, as a JSON object.
    if let output = result.snapshot.outputData {
        print(String(decoding: output, as: UTF8.self))
    }
}
```

It throws `UplinkConnectError` if the user backs out (`.cancelled`), sign-in can't start, or the action fails.

The output is a JSON object whose fields hold [vocabulary](https://docs.uplink.build/vocabulary/overview.md) types — Progressive's `fetchAll` returns `policies`, `vehicles`, and `claims`. [Semantic schemas](https://docs.uplink.build/connectors-ios/semantic-schemas.md) shows how to find and decode them.

> [!TIP]
>
> `present` keeps the sheet up until the action finishes. To let people keep using your app while data loads, use [background runs](https://docs.uplink.build/connectors-ios/invoking-actions.md#background-runs) instead.

## What's next

> [card] [Invoking connector actions](https://docs.uplink.build/connectors-ios/invoking-actions.md)
>
> Connect, refresh, background runs, and issuing user tokens

> [card] [Displaying invocation state](https://docs.uplink.build/connectors-ios/invocation-state.md)
>
> Observe progress and sign-in state in your own UI

> [card] [Semantic schemas](https://docs.uplink.build/connectors-ios/semantic-schemas.md)
>
> Decode output into vocabulary types

> [card] [Native iOS SDK](https://docs.uplink.build/api-reference/ios.md)
>
> The on-device browser that connectors drive


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.