System Requirements
- Flutter SDK 3.0 or higher
- Dart 2.17 or higher
- iOS 14.0 or higher
- Android API level 24 (Android 7.0) or higher
- For Web: Modern browsers with JavaScript enabled
- SDK Size: ~120 KB (plus native iOS and Android SDK dependencies)
Installation
Add Dependency
Android Configuration
1. Update Minimum SDK Version
Update the Android minimumminSdk to 24 in android/app/build.gradle:
2. Add Maven Repository
If an exception occurs during the build stating that theai.verisoul:android package cannot be downloaded, add the following Maven repository inside your android/build.gradle file:
iOS Configuration
For iOS-specific configuration including Device Check and App Attest setup, please refer to the iOS SDK Documentation.Usage
Initialize the SDK
Callconfigure() before you intend to retrieve a Verisoul session_id:
configure() method initializes the Verisoul SDK with your project credentials. Only initialize the SDK if you plan to retrieve a session_id and call the Verisoul API for that session.
Parameters:
projectId: Your unique Verisoul project identifierenvironment: The environment to useVerisoulEnvironment.prodfor production orVerisoulEnvironment.sandboxfor testing
Get Session ID
ThegetSessionApi() method returns the current session identifier after the SDK has collected sufficient device data. This session ID is required to request a risk assessment from Verisoul’s API.
Important Notes:
- Session IDs are short-lived and expire after 24 hours
- The session ID becomes available once minimum data collection is complete (typically within seconds)
- You should send this session ID to your backend, which can then call Verisoul’s API to get a risk assessment
Provide Touch Events
Wrap your App withVerisoulWrapper to automatically capture touch events:
Web Support
Add Verisoul Script
Add the Verisoul script to yourweb/index.html:
{env}: Use eitherprodorsandbox{project_id}: Your project ID, which must match the environment
Content Security Policy (CSP)
If your application has a Content Security Policy, update it to include the following Verisoul domains:Set Account Data (Web Only)
ThesetAccountData() function provides a simplified way to send user account information to Verisoul directly from the client side. While easy to integrate, this method has important limitations:
- Offline analysis only: Data sent via account() is only visible in the Verisoul dashboard
- No real-time decisions: Unlike the server-side API, this method doesn’t allow your application to receive and act on Verisoul’s risk scores in real-time
- Limited use case: Designed specifically for initial pilots and evaluation purposes
Error Codes
The SDK throwsVerisoulException with the following error codes:
Exception Structure
All errors are thrown asVerisoulException with the following properties:
