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

# Accessing the Airia Mobile SDK

Looking to learn how to download the Airia SDK? Check out this document to get started.

Access to the SDK is provided using a private Swift Package Registry. You will need to modify your local Swift Package Manager configuration in order to download the AiriaSDK package.

## Obtain an Access Token

You can obtain an access token from your Airia account representative. The token will be used in the following step to allow the Swift Package Manager to access the private registry.

## Configure Swift Package Manager

### Add Airia Swift Package Registry

Use the `swift package-registry set` command to add the registry to your SPM config with the `airia` scope. If you are using Xcode to manage your Swift packages, then you need to add the registry to your global SPM config.

```
swift package-registry set --global --scope airia https://airia.jfrog.io/artifactory/api/swift/airia-swift-local
```

### Authenticate with the Registry

Use the `swift package-registry login` command to authenticate with the package registry. This will store your token in the macOS Keychain.

```
swift package-registry login https://airia.jfrog.io/artifactory/api/swift/airia-swift-local --token <YOUR_ACCESS_TOKEN>
```

Once authenticated, verify in keychain access.

<img src="https://mintcdn.com/airia/-IdzcTrqgXiTBMZw/developers-hub/capabilities/img/jfrog-token.png?fit=max&auto=format&n=-IdzcTrqgXiTBMZw&q=85&s=baecfaaa41e70eadfde1eeb2de430d79" alt="Jfrog Token Verfiy View" width="1988" height="520" data-path="developers-hub/capabilities/img/jfrog-token.png" />

## Add AiriaSDK as a Dependency

### Using Package.swift

If you are managing your dependencies in Package.swift, then add it to your dependencies array using `.package(id:from:)` with `airia.AiriaSDK` for the id.

```

import PackageDescription

let package = Package(
    name: "Example",
    products: [ 
        .executable(name: "Example", targets: ["Example"])
    ],
    dependencies: [
        .package(id: "airia.AiriaSDK", from: "1.0.0")
    ],
    targets: [
        .executableTarget(
            name: "Example",
            dependencies: [
                .product(name: "AiriaSDK", package: "Airia")
            ]
        ),
    ]
)
```

### Using Xcode

If you are managing your dependencies through Xcode's UI, then you can search for the package using `airia.AiriaSDK`.

1. Being by selecting your project in Xcode and navigating to the `Package Dependencies` tab. Then, click the plus icon '+' below the list of packages.

   <img src="https://mintcdn.com/airia/-IdzcTrqgXiTBMZw/developers-hub/capabilities/img/xcode-package-deps-empty.png?fit=max&auto=format&n=-IdzcTrqgXiTBMZw&q=85&s=d76ea1ade736d9abfed26a53b6b8acd5" alt="Xcode Package Dependencies View" width="1356" height="566" data-path="developers-hub/capabilities/img/xcode-package-deps-empty.png" />
2. You will be prompted to allow Xcode to access the registry token stored in the macOS Keychain. Enter your macOS User password, and click "Always Allow."

   <img src="https://mintcdn.com/airia/-IdzcTrqgXiTBMZw/developers-hub/capabilities/img/xcode-keychain-access.png?fit=max&auto=format&n=-IdzcTrqgXiTBMZw&q=85&s=773fe15f956df35fa7c734508d097f80" alt="Xcode Keychain Access Prompt" width="1040" height="396" data-path="developers-hub/capabilities/img/xcode-keychain-access.png" />

   Note: Sometimes this popup doesnot copme up as expected. Verify in Keychain access

   <img src="https://mintcdn.com/airia/-IdzcTrqgXiTBMZw/developers-hub/capabilities/img/access-control.png?fit=max&auto=format&n=-IdzcTrqgXiTBMZw&q=85&s=53a8d3db2766413ba8481b0749f64b3c" alt="Access Control Check" width="1770" height="1588" data-path="developers-hub/capabilities/img/access-control.png" />
3. Finally search for the AiriaSDK by entering `airia.AiriaSDK` complete text (partial search does not work everytime) into the search field located in the top right corner. Then click "Add Package" in the bottom right corner.

   <img src="https://mintcdn.com/airia/-IdzcTrqgXiTBMZw/developers-hub/capabilities/img/xcode-package-search.png?fit=max&auto=format&n=-IdzcTrqgXiTBMZw&q=85&s=eb123fd12891a4ef139488f923adc0f2" alt="Xcode Package Search Window" width="1040" height="619" data-path="developers-hub/capabilities/img/xcode-package-search.png" />
