Flutter (Mobile)
Step-by-step instructions for integrating the Para Flutter SDK into your mobile app.
This guide walks you through the setup of Para in a Flutter application. You’ll learn how to install the SDK and configure iOS/Android for passkey-based logins , implement user flows for email, phone, or OAuth, and generate wallets and sign transactions.
If you haven’t already created your Flutter app, follow the official Flutter docs to set up a new project.
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
Start by installing the Para SDK:
Project Setup
To set up associated domains for passkey functionality in your Flutter project, you need to configure both iOS and Android platforms:
To enable passkeys on iOS, you need to set up associated domains in your Xcode project:
- Open your Flutter project’s iOS folder in Xcode
- Select your target and go to “Signing & Capabilities”
- Click ”+ Capability” and add “Associated Domains”
- Add the following domains:
webcredentials:app.beta.getpara.com
webcredentials:app.getpara.com
For more details, see the Apple Developer documentation.
teamId + bundleIdentifier
with the Para team to set up associated domains. For example, if your Team ID is A1B2C3D4E5
and Bundle Identifier is com.yourdomain.yourapp
, provide A1B2C3D4E5.com.yourdomain.yourapp
to Para. This is required by Apple for passkey security. Allow up to 24 hours for domain propagation.Initializing Para
To use Para’s features, you’ll need to initialize a Para client instance that can be accessed throughout your app. This client handles all interactions with Para’s services, including authentication, wallet management, and transaction signing.
First, create a file (e.g., lib/services/para_client.dart
) to initialize your Para client:
Next, ensure Flutter’s widgets are properly initialized before your app starts. Update your main.dart
:
You can access para
from anywhere in your app by importing the file where you initialized it. This singleton pattern
ensures consistent state management across your application.
Authentication
Para provides multiple authentication methods including email, phone, and OAuth. The email and phone flows follow a similar pattern but with slightly different method calls. Here’s a detailed breakdown of each step in the authentication process:
User Creation
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.
The verification code (OTP) is automatically sent when calling createUser
or createUserByPhone
. You’ll need to
implement UI to collect this code from the user before proceeding with verification.
When createWallet
is called with skipDistribute: false
, Para automatically handles the distribution of backup
shares. Seucrely show this information to the user in your app.
User Login
Logging in with Para is straightforward using the login()
method. When called, this triggers the platform’s native
passkey selection UI, allowing users to authenticate with any passkeys associated with your app on their device:
The login method returns the user’s primary wallet. If you need access to additional wallets, you can fetch them using
para.getWallets()
.
Transaction Signing
Once a user is authenticated, Para provides three methods for signing operations:
signMessage
- Signs arbitrary datasignTransaction
- Signs EVM-specific transactions (requires RLP encoding)sendTransaction
- Signs and broadcasts RLP-encoded transactions directly
Here’s how to use each method:
General Message Signing
signMessage
works with raw bytes in base64 format and will sign ANY provided data without validation. Always ensure
your transaction construction is correct before signing.
Transaction Signing
For blockchain transactions, you’ll typically:
- Construct the transaction using a chain-specific library
- Serialize it to bytes
- Convert to base64
- Sign using Para
Direct Transaction Submission
For EVM chains, you can use sendTransaction
to sign and submit in one call:
For EVM transactions, consider using signTransaction
instead of signMessage
as it provides additional validation
specific to EVM chains.
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.