Swift (iOS)
Step-by-step instructions for integrating the Para Swift SDK into your iOS app.
The Para SDK for Swift helps you integrate secure wallet features (creation, passkey-based authentication, transaction signing) into your iOS app. Below is an expanded guide that:
- Describes environment setup for associated domains and passkeys
- Shows how to create and log in users via email, phone, or OAuth
- Demonstrates the final steps of wallet creation and basic message signing
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 and Configuration
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 Up to Next Major Version ensuring
0.0.1 < 1.0.0
- Add the package to your app target and click Add Package.
Associated Domains for Passkeys
To enable passkeys on iOS, you need to configure Associated Domains:
- In Xcode, go to Signing & Capabilities and add Associated Domains.
- Add:
- Provide your Team ID + Bundle ID to Para, e.g.
A1B2C3D4E5.com.example.yourapp
.
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.
Initializing the Para Manager
Below is a typical SwiftUI @main
App demonstrating how to load environment and API keys from Info.plist, then set up
Para:
Authentication Flows
Passkeys let you authenticate users with either email, phone (OTP-based), or OAuth. Each flow shares a common pattern:
- Check if user exists (by email or phone)
- Create user if new, which triggers OTP
- Verify OTP and generate passkey
- Create wallet to store user’s assets
Use the same ParaManager
instance for each step. The code below outlines email-based creation. Phone and OAuth are
structurally similar but call their respective methods (createUserByPhone
, verifyByPhone
,
generatePasskey(identifier:...)
, etc.).
Check User Existence
Create User & Verify OTP
Generate Passkey & Create Wallet
Logging In Existing Users
Once the user has a passkey (they’ve previously created or logged in), logging in is straightforward:
This triggers a biometric prompt, verifying the passkey before unlocking the wallet. On success, you can fetch wallets or sign transactions.
Signing Messages or Transactions
You can sign arbitrary messages (e.g., EVM or Solana transactions) by passing Base64-encoded bytes. For instance:
For complex transactions (EVM, Solana, Cosmos, etc.), ensure you serialize them properly and only then call
signMessage
.
Example Project
For more complete usage patterns, including a SwiftUI app demonstrating email, phone, and OAuth flows, as well as passkey creation and transaction signing:
Integration Support
If you’re experiencing issues that aren’t resolved by our troubleshooting resources, please contact our team for assistance. To help us resolve your issue quickly, please include the following information in your request:
1
A detailed description of the problem you’re encountering.
2
Any relevant error messages or logs.
3
Steps to reproduce the issue.
4
Details about your system or environment (e.g., device, operating system, software version).
Providing this information will enable our team to address your concerns more efficiently.