In order to perform an Onboarding or an Authenticate, you should follow those steps:
: install and import the SDK
: request a token using your business credentials
: launch a user workflow and use the Message handler to get insights about the user workflow
: use your callback or the endpoint to get the analysis result
1. Set up the SDK
1.1. Project requirements
The proper functioning of the SDK necessitates the provision of several parameters. These parameters are essential for enabling the full range of functionalities offered by the SDK.
minSdk or minSdkVersion = 24
1.2. Install SDK
ShareID use Maven to provide its SDK securely with authentication managed in your AppName/android/build.gradle file.
To install the SDK, you'll need to add the dependency in your app module.
Add the following to your build.gradle
implementation("ai.shareid:sdk:+") // or specific version
You can now synchronise and use the SDK in your project
Make sure you update your various dependencies, distributionUrl, IDE, gradle version or anything else.
Conflicts of dependency
The SDK directly integrates most of the dependencies it uses to simplify your integration.
1.1. Project requirements
The proper functioning of the SDK necessitates the provision of several parameters. These parameters are essential for enabling the full range of functionalities offered by the SDK.
iOS 15+ (because of Swift minimum version)
Available for iPhone and iPad in portrait mode only
Mandatory app permission
The SDK uses the device's camera functionality.
1.2. Install SDK
To securely manage your credentials, you’ll need to create a .netrc file in your home directory with the necessary login details.
To install the SDK with CocoaPods, you'll need to add the dependency to your Podfile. (if it doesn't exist, create one by running the following command in your project directory: pod init)
Add the following to your target
platform :ios, min_ios_version_supported
target '<your-app>' do
use_frameworks!
pod 'shareid-sdk-ios' # or specific version
end
Run pod install to install the dependency
Now, you can import and use the SDK in your project
import shareid_sdk_ios
Signing & Capabilities
Before running your React Native app with the ShareID SDK, you must configure Signing & Capabilities in Xcode to avoid build errors.
2. Get a token
Use the credentials you received from ShareID's team to get an authenticate token and launch an onboarding or authenticate workflow.
3. Start an onboarding or authenticate flow and get the user workflow result from SDK
Use your token to start an onboarding or an authenticate.
You can use the npx @react-native-community/cli init AppName command directly into Demo folder if you are starting a new project.
Tips
To keep the module decoupled from the application, we recommend that you define it separately from the application and then add it to your application as a dependency at a later date.
Don't forget to change the AppName field
Step 2: JS module configuration
The JavaScript module acts as an interface between React Native and the native code.
Create a NativeShareID.ts file in the js:
TurboModule
import type { TurboModule } from "react-native/Libraries/TurboModule/RCTExport";
import { TurboModuleRegistry } from "react-native";
// Define the interface for the TurboModule
export interface Spec extends TurboModule {
/**
* Start the ShareID service with the provided token.
* @param token - Authentication token
*/
signIn(token: string): void;
signUp(token: string): void;
}
// Retrieve the TurboModule instance from the registry
const RTNShareID = TurboModuleRegistry.get<Spec>("RTNShareID");
export default RTNShareID;
NativeModule
import { NativeModules } from "react-native";
const { RTNShareID } = NativeModules;
export interface Spec {
/**
* Start the ShareID service with the provided token.
* @param token - Authentication token
*/
signIn(token: string): void;
signUp(token: string): void;
}
export default RTNShareID as Spec;
When the processing of an onboarding request is finished, you may receive the result through the callback if you provided it. You may also, fetch yourself the result by calling our API.
Customisation
The ShareID SDK is designed to be highly customisable, allowing great flexibility through various configuration options or the application of themes to adapt the user interface to your needs. To do this, simply follow this same section in the Android and iOS documentation and add them to your code.
However, conflicts may arise that require you to integrate dependencies yourself (notably , , , etc.).
You must add NSCameraUsageDescription within your application's Info.plist file (see ).
ShareID supports with authenticate handled via a .netrc file.
Depending on the SDK you are integrating (Onboarding/Authenticate), you may use an API here
The module creates a bridge between your JavaScript code and native Android code, enabling you to use ShareID's specific features in React Native. (Native or works)
All the code above is an example of Kotlin integration. You can also use Java by referring to the documentation.