System Requirements
- React Native 0.60 or higher
- iOS 14.0 or higher
- Android API level 21 (Android 5.0) or higher
- For Expo projects: Expo SDK 45 or higher with custom development client
Installation
Using NPM
Using Yarn
Android Configuration
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:
Expo Projects
The Verisoul SDK is not supported in Expo Go. If you are using the managed workflow, you will need to use Expo’s custom development client.- Install expo-dev-client:
- Modify the scripts section in your
package.jsonfile:
- Install Verisoul SDK:
- If needed, add the Maven repository to your
android/build.gradlefile as shown in the Android Configuration section above.
Usage
Initialize the SDK
Theconfigure() method initializes the Verisoul SDK with your project credentials. This method must be called once when your application starts.
Parameters:
environment: The environment to useVerisoulEnvironment.prodfor production orVerisoulEnvironment.sandboxfor testingprojectId: Your unique Verisoul project identifier
getSessionId()
ThegetSessionID() 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
- A new session ID is generated each time the SDK is initialized or when
reinitialize()is called
reinitialize()
Thereinitialize() method generates a fresh session ID and resets the SDK’s data collection. This is essential for maintaining data integrity when user context changes.
Example:
getSessionID() to retrieve the new session identifier.
Provide Touch Events
Touch event data is collected and analyzed to detect automated/bot behavior by comparing touch patterns with device sensor data. This helps identify anomalies that may indicate fraud. React Native Setup: Wrap your root component withVerisoulTouchRootView to automatically capture touch events across both iOS and Android:
