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.

Don’t have an API key yet? Request access to the Developer Portal to create API keys, manage billing, teams, and more.

Installation

1

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 ensuring 0.0.1 < 1.0.0
  4. Add the package to your app target and click Add Package.
2

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. Provide your Team ID + Bundle ID to Para, e.g. A1B2C3D4E5.com.example.yourapp

Without properly registering your domain with Para, passkey authentication flows will fail. Contact Para support if you encounter issues with passkey registration.

Beta Testing Credentials In the BETA Environment, you can use any email ending in @test.getpara.com (like dev@test.getpara.com) or US phone numbers (+1) in the format (area code)-555-xxxx (like (425)-555-1234). Any OTP code will work for verification with these test credentials. These credentials are for beta testing only. You can delete test users anytime in the beta developer console to free up user slots.

Initialization

First, you need to initialize the Para manager in your app. Below is an example of initializing the SDK in a SwiftUI application:

import SwiftUI
import ParaSwift

@main
struct ExampleApp: App {
    @StateObject private var paraManager: ParaManager
    @StateObject private var appRootManager = AppRootManager()

    init() {
        let environmentString = Bundle.main.object(forInfoDictionaryKey: "PARA_ENVIRONMENT") as? String ?? "beta"
        let environment: ParaEnvironment = environmentString == "beta" ? .beta : .prod
        let apiKey = Bundle.main.object(forInfoDictionaryKey: "PARA_API_KEY") as! String

        _paraManager = StateObject(wrappedValue: ParaManager(environment: environment, apiKey: apiKey))
    }

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

Authentication

Para supports email and phone authentication methods. Each method uses a secure, passkey-first approach for seamless biometric logins via Face ID or Touch ID.

Email authentication verifies users via a one-time password (OTP) sent to their email address and then sets up a biometric-enabled passkey for future logins.

1

Check User Existence

First, check if the user already exists in the Para system:

let userExists = try await paraManager.checkIfUserExists(email: userEmail)
2

For Existing Users: Login with Passkey

If the user exists, trigger the passkey login flow:

try await paraManager.login(
    authorizationController: authorizationController,
    authInfo: EmailAuthInfo(email: userEmail)
)
3

For New Users: Create Account

If the user does not exist, initiate the account creation process:

// Create user - this sends a verification code to the email
try await paraManager.createUser(email: userEmail)

// User enters verification code from their email
let verificationCode = "123456" // Replace with actual code from UI input

// Verify the code to get a biometrics ID
let biometricsId = try await paraManager.verify(verificationCode: verificationCode)
4

Generate Passkey and Create Wallet

After verification, generate a passkey and create a wallet:

// Create passkey linked to the email
try await paraManager.generatePasskey(
    identifier: userEmail,
    biometricsId: biometricsId,
    authorizationController: authorizationController
)

// Create wallet for the new user
try await paraManager.createWallet(type: .evm, skipDistributable: false)

Subsequent Logins

After initial setup, users can log in using their passkey, which triggers biometric authentication:

// For users who have already set up a passkey
try await paraManager.login(authorizationController: authorizationController)

This will prompt the user for Face ID or Touch ID verification before granting access to their wallets.

Checking Authentication Status

You can check if a user is already authenticated:

let isLoggedIn = await paraManager.isFullyLoggedIn()

if isLoggedIn {
    // User is authenticated, proceed to main app flow
} else {
    // Show login/signup UI
}

Sign out

To sign out a user and clear their session:

try await paraManager.logout()

Basic Wallet Operations

After successful authentication, you can perform wallet operations:

// Get all user wallets
let wallets = try await paraManager.getWallets()

// Sign a simple message
let messageData = "Hello, Para!".data(using: .utf8)!
let base64Message = messageData.base64EncodedString()
let signature = try await paraManager.signMessage(
    walletId: wallets.first!.id, 
    message: base64Message
)

For detailed transaction signing with specific blockchains (EVM, Solana, Cosmos), please refer to the respective blockchain integration guides.

Example

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

Next Steps

After integrating Para into your Flutter app, you can explore other features and integrations to enhance your Para experience.