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, configure iOS/Android for passkey-based logins, implement user authentication flows, and generate wallets.
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.usecapsule.com
webcredentials:app.usecapsule.com
For more details, see the Apple Developer documentation.
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.usecapsule.com
webcredentials:app.usecapsule.com
For more details, see the Apple Developer documentation.
For Android setup, you need to provide your app’s SHA-256 certificate fingerprint to Para.
com.getpara.example.flutter
as your package name for immediate testing. This package name is pre-registered and works with the SHA-256 certificate from the default debug.keystore, making it testable in debug mode for newly scaffolded Flutter apps.Fix Namespace Issue
For newer versions of Flutter, you need to add the following configuration block to your android/build.gradle
file to resolve a namespace issue with the passkey dependency:
Get SHA-256 Fingerprint
To get your SHA-256 fingerprint:
- For debug builds:
keytool -list -v -keystore ~/.android/debug.keystore
- For release builds:
keytool -list -v -keystore <your_keystore_path>
To ensure passkey functionality works correctly:
- Enable biometric or device unlock settings (fingerprint, face unlock, or PIN)
- Sign in to a Google account on the device (required for Google Play Services passkey management)
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.
Create a file (e.g., lib/services/para_client.dart
) to initialize your Para client:
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.
Para offers two hosted environments: Environment.BETA
(alias Environment.DEVELOPMENT
) for testing, and
Environment.PROD
(alias Environment.PRODUCTION
) for live use. Select the environment that matches your current
development phase.
Using the Para SDK
The Para SDK provides multiple authentication methods including email and phone. Here’s how to implement these methods in your Flutter application.
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.
Create a User with Email
Follow these steps to register a new user with email verification:
Login with Email
To authenticate an existing user with their email:
You can also check if a user is already logged in:
Create a User with Email
Follow these steps to register a new user with email verification:
Login with Email
To authenticate an existing user with their email:
You can also check if a user is already logged in:
Create a User with Phone
Follow these steps to register a new user with phone verification:
+1234567890
with the country code included. For country code ensure a + is included.Login with Phone
To authenticate an existing user with their phone number:
Resend Verification Code
If the user doesn’t receive the verification code:
When createWallet
is called with skipDistribute: false
, Para automatically handles the distribution of backup
shares. Make sure to securely store and display the recovery secret to the user in your app as it’s essential for account recovery.
Working with Wallets
Once a user is authenticated, you can access and manage their wallets:
Examples
For practical implementations of the Para SDK in Flutter environments, check out our GitHub repository:
Troubleshooting
If you encounter issues during the integration or usage of the Para SDK in your Flutter application, here are some common problems and their solutions:
Next Steps
After integrating Para into your Flutter app, you can explore other features and integrations to enhance your Para experience.