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.
Install the SDK
1
Add the Para Swift SDK Package
- In your Xcode project, go to File > Add Packages or (in your target) Frameworks, Libraries, and Embedded Content and click +.
- Enter
https://github.com/getpara/swift-sdk
- Select Branch and enter
2.0.0-alpha
- Add the package to your app target and click Add Package.
- BigInt: For handling large numbers in blockchain operations
- PhoneNumberKit: For phone number validation and formatting
2
Configure Associated Domains for Passkeys
To enable passkeys on iOS, you need to configure Associated Domains:
- In Xcode, go to Signing & Capabilities for your app target
- Click + Capability and add Associated Domains
- Add the following entries:
- Register your Team ID + Bundle ID with Para via the Developer Portal
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.
Configure URL Scheme
Before initializing Para, you need to configure your app’s URL scheme for deep linking. This is required for theappScheme
parameter and enables OAuth authentication flows.
1
Add URL Scheme in Xcode
- In Xcode, select your project in the navigator
- Select your app target
- Go to the Info tab
- Scroll down to URL Types and click + to add a new URL type
- Fill in the fields:
- URL Schemes: Enter your scheme name (e.g.,
paraswift
,yourapp
) - Role: Select Editor
- URL Schemes: Enter your scheme name (e.g.,
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:App.swift
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.Authenticate Users
Para provides a unified authentication experience that supports email, phone, and social login methods. The SDK automatically determines whether a user is new or existing and guides you through the appropriate flow.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.Build Your Authentication Flow
The recommended approach is to create a single authentication view that handles all authentication methods together. This provides users with all authentication options in one place.Para supports authentication with both email addresses and phone numbers.
1
Handle Email/Phone Submission
Initiate authentication with email or phone:
AuthenticationView.swift
2
Handle OTP Verification
For new users who need verification, handle the OTP flow:
AuthenticationView.swift
Handle Returning Users
After initial setup, users can log in using their email or phone with the same authentication flow:LoginView.swift
LoginView.swift
Check Authentication Status
You can check if a user is already authenticated:ContentView.swift
Sign Out Users
To sign out a user and clear their session:SettingsView.swift
Create and Manage Wallets
After successful authentication, you can perform wallet operations:WalletView.swift
For detailed transaction signing with specific blockchains (EVM, Solana, Cosmos), please refer to the respective blockchain integration guides.