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

# Setup

> Step-by-step guide for integrating the Para Swift SDK into your iOS application

export const DemoCallout = ({variant = "card", title = "Interactive Demo", description = "Try the live demo to explore authentication flows and customize your modal before integrating."}) => {
  if (variant === "subtle") {
    return <div className="not-prose my-4 px-4 py-3 rounded-xl border border-orange-200 bg-orange-50/50">
        <div className="flex items-center justify-between gap-4">
          <p className="text-sm text-gray-700 m-0">
            {description}
          </p>
          <a href="https://demo.getpara.com/" target="_blank" rel="noopener noreferrer" className="not-prose flex-shrink-0 inline-flex items-center gap-2 px-3 py-1.5 text-xs font-semibold text-orange-600 bg-white border border-orange-200 rounded-lg hover:bg-orange-50 transition-colors no-underline">
            Try Demo
            <svg width="12" height="12" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
              <path d="M40 472L472 40M472 40H83.2M472 40V428.8" stroke="currentColor" strokeWidth="66.6667" strokeLinecap="round" strokeLinejoin="round" />
            </svg>
          </a>
        </div>
      </div>;
  }
  return <a href="https://demo.getpara.com/" target="_blank" rel="noopener noreferrer" className="not-prose block my-4 p-5 rounded-xl bg-gradient-to-r from-orange-600 via-pink-600 to-purple-600 hover:opacity-95 transition-opacity no-underline">
      <div className="flex items-center justify-between gap-4">
        <div>
          <h3 className="text-base font-semibold text-white m-0">{title}</h3>
          <p className="text-xs text-white/80 mt-1 m-0">{description}</p>
        </div>
        <div className="flex-shrink-0 w-8 h-8 rounded-full bg-white/20 flex items-center justify-center">
          <svg width="14" height="14" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
            <path d="M40 472L472 40M472 40H83.2M472 40V428.8" stroke="white" strokeWidth="66.6667" strokeLinecap="round" strokeLinejoin="round" />
          </svg>
        </div>
      </div>
    </a>;
};

export const Link = ({href, label, newTab = false}) => {
  const [isHovered, setIsHovered] = useState(false);
  return <a href={href} target={newTab ? '_blank' : '_self'} rel={newTab ? 'noopener noreferrer' : undefined} className="not-prose inline-block relative text-black font-semibold cursor-pointer border-b-0 no-underline" onMouseEnter={() => setIsHovered(true)} onMouseLeave={() => setIsHovered(false)}>
      {label}
      <span className={`absolute left-0 bottom-0 w-full rounded-sm bg-gradient-to-r from-orange-600 to-purple-600 transition-all duration-300 ${isHovered ? 'h-0.5' : 'h-px'}`} />
    </a>;
};

The Para Swift SDK enables you to integrate secure wallet features including creation, passkey-based authentication, and transaction signing into your iOS applications. This guide covers all necessary steps from installation to implementing authentication flows.

## Prerequisites

To use Para, you need an API key. This key authenticates your requests to Para services and is essential for
integration.

<Warning>
  Don't have an API key yet? Request access to the <Link label="Developer Portal" href="https://developer.getpara.com" /> to create API keys, manage billing, teams, and more.
</Warning>

<DemoCallout variant="subtle" />

## Install the SDK

<Steps>
  <Step title="Add the Para Swift SDK Package">
    1. In your Xcode project, go to **File > Add Packages** or (in your target) **Frameworks, Libraries, and Embedded Content** and click **+**.
    2. Enter `https://github.com/getpara/swift-sdk`
    3. Select **Up to Next Major Version** and enter `3.0.0`
    4. Add the package to your app target and click **Add Package**.

    The Para Swift SDK automatically includes the following dependencies:

    * **BigInt**: For handling large numbers in blockchain operations
    * **PhoneNumberKit**: For phone number validation and formatting

    These dependencies will be automatically resolved by Swift Package Manager.
  </Step>

  <Step title="Configure Associated Domains for Passkeys">
    To enable passkeys on iOS, you need to configure Associated Domains:

    1. In Xcode, go to **Signing & Capabilities** for your app target
    2. Click **+ Capability** and add **Associated Domains**
    3. Add the following entries:
       ```
       webcredentials:app.usecapsule.com
       webcredentials:app.beta.usecapsule.com
       ```
    4. Register your Team ID + Bundle ID with Para via the <Link label="Developer Portal" href="https://developer.getpara.com" />

    <Warning>
      Without properly registering your Team ID and Bundle ID with Para, passkey authentication flows will fail. Contact Para support if you encounter issues with passkey registration.
    </Warning>

    <Note>
      Heading to App Review? Check <Link label="iOS App Store Submission" href="/v3/general/ios-app-store-submission" /> for Sign in with Apple, reviewer, and deletion tips.
    </Note>
  </Step>
</Steps>

## Configure URL Scheme

Before initializing Para, you need to configure your app's URL scheme for deep linking. This is required for the `appScheme` parameter and enables OAuth authentication flows.

<Steps>
  <Step title="Add URL Scheme in Xcode">
    1. In Xcode, select your project in the navigator
    2. Select your app target
    3. Go to the **Info** tab
    4. Scroll down to **URL Types** and click **+** to add a new URL type
    5. Fill in the fields:
       * **URL Schemes**: Enter your scheme name (e.g., `paraswift`, `yourapp`)
       * **Role**: Select **Editor**
  </Step>
</Steps>

## Initialize Para

To use Para's features, you'll need to initialize a Para manager that can be accessed throughout your app. This manager handles all interactions with Para's services, including authentication, wallet management, and transaction signing.

Below is an example of initializing the SDK in a SwiftUI application:

```swift App.swift theme={null}
import SwiftUI
import ParaSwift

@main
struct ExampleApp: App {
    @StateObject private var paraManager: ParaManager

    init() {
        // Initialize Para manager
        _paraManager = StateObject(wrappedValue: ParaManager(
            environment: .beta, // Use .prod for production
            apiKey: "YOUR_API_KEY_HERE", // Get from: https://developer.getpara.com
            appScheme: "yourapp" // Your app's URL scheme for deep linking
        ))
    }

    var body: some Scene {
        WindowGroup {
            ContentView()
                .environmentObject(paraManager)
        }
    }
}
```

<Note>
  The `appScheme` parameter must match the URL scheme you configured in your Info.plist. This enables deep linking for external wallet integrations like MetaMask and OAuth authentication flows.
</Note>

## Continue with Authentication

Once Para is initialized, implement your auth experience using the Authentication & Users guides:

* <Link label="Email & Phone Login" href="/v3/swift/guides/email-phone-login" />
* <Link label="Add Social Login" href="/v3/swift/guides/social-login" />

For wallet creation and transaction signing examples, jump into the blockchain guides:

* <Link label="EVM Integration" href="/v3/swift/guides/evm" />
* <Link label="Solana Integration" href="/v3/swift/guides/solana" />
* <Link label="Cosmos Integration" href="/v3/swift/guides/cosmos" />
* <Link label="Stellar Integration" href="/v3/swift/guides/stellar" />

## Example

For a complete implementation example, check out our Swift SDK example app:

<Card horizontal title="Swift SDK Example App" imgUrl="/images/v3/framework-swift.png" href="https://github.com/getpara/examples-hub/tree/3.0.0/mobile/with-swift" description="See an end-to-end example of Para Swift SDK integration." />

## Next Steps

After setup, use these guides for authentication and wallet signing flows.

<CardGroup cols={3}>
  <Card title="Email & Phone Login" imgUrl="/images/v3/framework-swift.png" href="/v3/swift/guides/email-phone-login" description="Add email and phone authentication" />

  <Card title="EVM Integration" imgUrl="/images/v3/network-evm.png" href="/v3/swift/guides/evm" description="Sign EVM transactions with Para SDK" />

  <Card title="Solana Integration" imgUrl="/images/v3/network-solana.png" href="/v3/swift/guides/solana" description="Sign Solana transactions with Para SDK" />

  <Card title="Cosmos Integration" imgUrl="/images/v3/network-cosmos.png" href="/v3/swift/guides/cosmos" description="Sign Cosmos transactions with Para SDK" />

  <Card title="Stellar Integration" imgUrl="/images/v3/network-stellar.png" href="/v3/swift/guides/stellar" description="Sign Stellar transactions with Para SDK" />
</CardGroup>
