This repository is a runnable React Native app that demonstrates how to launch the ComplyCube mobile flow using @complycube/react-native.
It is intended for developers who want a working reference for:
- Setting up credentials (
clientID,clientToken) - Starting the SDK with
ComplyCube.startSafe(...) - Handling success, cancel, and error outcomes
- Troubleshooting common launch issues
For access to the Mobile SDK, contact your Account Manager or ComplyCube Support.
- Node.js 18+
- React Native development environment (Android Studio and/or Xcode)
- CocoaPods (for iOS)
- Clone and install dependencies:
git clone https://github.com/complycube/complycube-react-native-sdk.git
cd complycube-react-native-sdk
npm install- Install iOS pods (iOS only):
cd ios
pod install
cd ..- Start Metro:
npm start- Run the app:
# Android
npm run android
# iOS
npm run iosIn App.tsx, replace placeholders with real values:
const id = 'CLIENT_ID';
const token = 'SDK_TOKEN';You can generate these from:
This project launches the SDK with startSafe:
const out = await ComplyCube.startSafe({
stages: [],
...sdkSettings,
clientID: id,
clientToken: token,
});Important:
sdkSettingsmust provide either:- a non-empty
stagesarray, or - a
workflowTemplateId
- a non-empty
- If neither is provided, the SDK will not start.
const sdkSettings = {
stages: [
{
name: 'intro',
heading: 'Custom Screen Title',
message: 'Custom welcome message.',
},
{
name: 'documentCapture',
documentTypes: {
passport: true,
driving_license: ['GB', 'US'],
},
},
'faceCapture',
],
};startSafe returns one of three statuses:
successcancellederror
Recommended handling:
const out = await ComplyCube.startSafe(options);
switch (out.status) {
case 'success':
console.log('Verification completed:', out.result);
break;
case 'cancelled':
console.log('User cancelled:', out.message);
break;
case 'error':
console.error('SDK error:', out.message, out.details);
break;
}You can listen to SDK events:
import { subscribe } from '@complycube/react-native';
const unsubscribe = subscribe((message) => {
console.log('ComplyCube event:', message);
});
// cleanup when done
unsubscribe();The SDK uses camera and microphone capture flows. Ensure these keys exist in your app Info.plist:
NSCameraUsageDescriptionNSMicrophoneUsageDescription
Example values:
<key>NSCameraUsageDescription</key>
<string>Used to capture facial biometrics and documents</string>
<key>NSMicrophoneUsageDescription</key>
<string>Used to capture video biometrics</string>- Confirm
idandtokenare real values, not placeholders. - Ensure
sdkSettingsincludes validstagesorworkflowTemplateId. - Check Metro logs for
ComplyCube outcomeand inspectstatus+message.
- Reinstall pods:
cd ios
pod install
cd ..For detailed instructions on integrating our SDK, please refer to our integration guide.
- Call
ComplyCube.startSafefrom user interaction (button press) after app UI is active, not during early app initialization.
- Mobile SDK guide: https://docs.complycube.com/documentation/guides/mobile-sdk-guide
- React Native SDK package: https://www.npmjs.com/package/@complycube/react-native
- API reference: https://docs.complycube.com/api-reference
- ComplyCube website: https://www.complycube.com