{"_id":"@au10tixorg/secureme-sdk","_rev":"2-0f7f22f8b171268e23bdf4e97c228c87","name":"@au10tixorg/secureme-sdk","dist-tags":{"latest":"4.7.1"},"versions":{"4.7.0":{"name":"@au10tixorg/secureme-sdk","version":"4.7.0","keywords":["react-native","ios","android"],"author":{"name":"AU10TIX Mobile Team","email":"mobile@au10tix.com"},"license":"MIT","_id":"@au10tixorg/secureme-sdk@4.7.0","maintainers":[{"name":"au10tix_mobile","email":"RND_Mobile@au10tix.com"}],"homepage":"https://github.com/AugGlobal/reactnative-secure.me-sdk#readme","bugs":{"url":"https://github.com/AugGlobal/reactnative-secure.me-sdk/issues"},"dist":{"shasum":"55cb488ebed54c8a9987ea33e239e8de1b9690aa","tarball":"https://registry.npmjs.org/@au10tixorg/secureme-sdk/-/secureme-sdk-4.7.0.tgz","fileCount":37,"integrity":"sha512-TOfo9MGT7eVjTWsZUz3rY5DeYuWgUQaWtjLPJAsI084UYCh/hoCYLif7br+u4D2Np37dsO5g8PVnYKXWCQoM7w==","signatures":[{"sig":"MEYCIQC2JCcagP1iR/xXIbfXjwpdxDByKEk5EnMLdplcKTjZ+AIhAKgVy66MVskZ/tZmlrXkbLj4Kk03XZDKtGNlwUhcaOWX","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":93868},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"main":"lib/commonjs/index","types":"lib/typescript/index.d.ts","module":"lib/module/index","source":"src/index","gitHead":"da1beeaa47e5cf0a79110588aeab2240106de7df","scripts":{"lint":"eslint \"**/*.{js,ts,tsx}\"","pods":"cd example && pod-install --quiet","test":"jest","example":"yarn --cwd example","prepare":"husky","release":"release-it","bootstrap":"yarn example && yarn && yarn pods","typescript":"tsc --noEmit","lint-staged":"lint-staged"},"_npmUser":{"name":"au10tix_mobile","email":"RND_Mobile@au10tix.com"},"prettier":{"useTabs":false,"tabWidth":2,"quoteProps":"consistent","singleQuote":true,"trailingComma":"es5"},"overrides":{"glob":"^11.0.0"},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"tagName":"v${version}","commitMessage":"chore: release ${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":"angular"}}},"repository":{"url":"git+https://github.com/AugGlobal/reactnative-secure.me-sdk.git","type":"git"},"_npmVersion":"10.9.2","description":"A React Native bridge for implementing Secure.me native functionality","directories":{},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"_nodeVersion":"23.7.0","eslintConfig":{"root":true,"rules":{"prettier/prettier":["error",{"useTabs":false,"tabWidth":2,"quoteProps":"consistent","singleQuote":true,"trailingComma":"es5"}]},"extends":["@react-native","plugin:prettier/recommended"]},"eslintIgnore":["node_modules/","lib/"],"react-native":"src/index","publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","husky":"^9.1.7","react":"19.1.5","eslint":"^8.57.1","prettier":"^3.7.4","commitlint":"^20.3.0","release-it":"^19.2.2","typescript":"^5.9.3","@types/jest":"^29.5.0","lint-staged":"^16.2.7","pod-install":"^1.0.9","@types/react":"^19.0.0","react-native":"0.82.1","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.2.0","react-native-builder-bob":"^0.40.17","@react-native/babel-preset":"^0.82.1","@react-native/eslint-config":"^0.82.1","@commitlint/config-conventional":"^20.3.0","@release-it/conventional-changelog":"^10.0.4"},"peerDependencies":{"react":"*","react-native":"*"},"_npmOperationalInternal":{"tmp":"tmp/secureme-sdk_4.7.0_1780246160814_0.7181848628579148","host":"s3://npm-registry-packages-npm-production"},"react-native-builder-bob":{"output":"lib","source":"src","targets":["commonjs","module",["typescript",{"project":"tsconfig.build.json"}]]}},"4.7.1":{"name":"@au10tixorg/secureme-sdk","version":"4.7.1","description":"A React Native bridge for implementing Secure.me native functionality","main":"lib/commonjs/index","module":"lib/module/index","types":"lib/typescript/index.d.ts","react-native":"src/index","source":"src/index","scripts":{"test":"jest","typescript":"tsc --noEmit","lint":"eslint \"**/*.{js,ts,tsx}\"","lint-staged":"lint-staged","prepare":"husky","release":"release-it","example":"yarn --cwd example","pods":"cd example && pod-install --quiet","bootstrap":"yarn example && yarn && yarn pods"},"keywords":["react-native","ios","android"],"repository":{"type":"git","url":"git+https://github.com/AugGlobal/reactnative-secure.me-sdk.git"},"author":{"name":"AU10TIX Mobile Team","email":"mobile@au10tix.com"},"license":"MIT","bugs":{"url":"https://github.com/AugGlobal/reactnative-secure.me-sdk/issues"},"homepage":"https://github.com/AugGlobal/reactnative-secure.me-sdk#readme","publishConfig":{"registry":"https://registry.npmjs.org/"},"devDependencies":{"@commitlint/config-conventional":"^20.3.0","@react-native/babel-preset":"^0.82.1","@react-native/eslint-config":"^0.82.1","@release-it/conventional-changelog":"^10.0.4","@types/jest":"^29.5.0","@types/react":"^19.0.0","commitlint":"^20.3.0","eslint":"^8.57.1","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.2.0","husky":"^9.1.7","jest":"^29.7.0","lint-staged":"^16.2.7","pod-install":"^1.0.9","prettier":"^3.7.4","react":"19.1.5","react-native":"0.82.1","react-native-builder-bob":"^0.40.17","release-it":"^19.2.2","typescript":"^5.9.3"},"overrides":{"glob":"^11.0.0"},"peerDependencies":{"react":"*","react-native":"*"},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"lint-staged":{"*.{js,jsx,ts,tsx}":["eslint --fix","prettier --write"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"commitMessage":"chore: release ${version}","tagName":"v${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":"angular"}}},"eslintConfig":{"root":true,"extends":["@react-native","plugin:prettier/recommended"],"rules":{"prettier/prettier":["error",{"quoteProps":"consistent","singleQuote":true,"tabWidth":2,"trailingComma":"es5","useTabs":false}]}},"eslintIgnore":["node_modules/","lib/"],"prettier":{"quoteProps":"consistent","singleQuote":true,"tabWidth":2,"trailingComma":"es5","useTabs":false},"react-native-builder-bob":{"source":"src","output":"lib","targets":["commonjs","module",["typescript",{"project":"tsconfig.build.json"}]]},"gitHead":"885721160a9bb8ca77e2964a36bd6a12ee72c601","_id":"@au10tixorg/secureme-sdk@4.7.1","_nodeVersion":"25.2.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-5+IpjFzbbaifEjE1pcXIxiM2ur1iEVrJ8imzAuwl2kKwSm1c8Ce3wR7NTabOmJLT9szTIVdHqo0l1NnVlYvsOg==","shasum":"ecdef431ce5b050191e63ea343624ae2673cb970","tarball":"https://registry.npmjs.org/@au10tixorg/secureme-sdk/-/secureme-sdk-4.7.1.tgz","fileCount":37,"unpackedSize":94991,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDssUgMLVCiprrhxx32arO6n7CJfLEhjLU9knCPKAT/ugIgLBqw46k/AEJkCD8RnL+o7sXYweUHwo4jqGUrLzl4nlk="}]},"_npmUser":{"name":"au10tix_mobile","email":"RND_Mobile@au10tix.com"},"directories":{},"maintainers":[{"name":"au10tix_mobile","email":"RND_Mobile@au10tix.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/secureme-sdk_4.7.1_1780981367198_0.933761599640923"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-31T16:49:20.713Z","modified":"2026-06-09T05:02:47.461Z","4.7.0":"2026-05-31T16:49:20.932Z","4.7.1":"2026-06-09T05:02:47.356Z"},"bugs":{"url":"https://github.com/AugGlobal/reactnative-secure.me-sdk/issues"},"author":{"name":"AU10TIX Mobile Team","email":"mobile@au10tix.com"},"license":"MIT","homepage":"https://github.com/AugGlobal/reactnative-secure.me-sdk#readme","keywords":["react-native","ios","android"],"repository":{"type":"git","url":"git+https://github.com/AugGlobal/reactnative-secure.me-sdk.git"},"description":"A React Native bridge for implementing Secure.me native functionality","maintainers":[{"name":"au10tix_mobile","email":"RND_Mobile@au10tix.com"}],"readme":"# SecureMe SDK\n\nReact Native library for SecureMe integration (iOS & Android).\n\n## Development\n\n### Prerequisites\n\n- Node.js 14+ and npm\n- React Native development environment\n- For iOS: Xcode and CocoaPods\n- For Android: Android Studio and Java\n\n## 📖 Documentation\n\nFor a comprehensive overview of features, configuration options, and integration steps, please see the **[Integration Guide (GUIDE.md)](GUIDE.md)**.\n\n---\n\n### Building the Library\n\n1. **Clone the repository**\n\n   ```sh\n   git clone <repository-url>\n   cd reactnative-secure.me-sdk\n   ```\n\n2. **Install dependencies**\n\n   ```sh\n   yarn install\n   ```\n\n3. **Build the library**\n   ```sh\n   npx react-native-builder-bob build\n   ```\n\n### Clean Rebuild\n\nTo perform a complete clean rebuild:\n\n```sh\n# Clean all build artifacts and dependencies\nrm -rf lib node_modules package-lock.json yarn.lock .yarn/cache .yarn/install-state.gz example/node_modules example/package-lock.json example/ios/Pods example/ios/Podfile.lock\n\n# Reinstall and rebuild\nyarn install\nnpx react-native-builder-bob build\n```\n\n### Available Scripts\n\n- `yarn run typescript` - Type check with TypeScript\n- `yarn run lint` - Lint code with ESLint\n- `npx react-native-builder-bob build` - Build the library (via react-native-builder-bob)\n- `yarn test` - Run tests\n- `yarn run example` - Run commands in the example app\n- `yarn run pods` - Install iOS pods for the example app\n\n## iOS Setup\n\n### 1. Install Pods\n\nGo to your project's iOS folder and install dependencies:\n\n```sh\ncd ios\npod install\n```\n\n## Android Setup\n\n### 1. Minimum SDK Version\n\nEnsure your `android/build.gradle` has minimum SDK version 21 or higher:\n\n```gradle\nbuildscript {\n    ext {\n        minSdkVersion = 21\n    }\n}\n```\n\n## Usage\n\nHere is a basic example of how to integrate the SDK into your application.\n\n> **Note:** Use Named Import with curly braces `{ SecuremeSdk }`.\n\n```tsx\nimport React, { useEffect, useState } from 'react';\nimport {\n  SafeAreaView,\n  View,\n  Text,\n  Button,\n  StyleSheet,\n  Alert,\n  ActivityIndicator,\n  Linking,\n  Platform,\n  PermissionsAndroid,\n} from 'react-native';\n\nimport { SecuremeSdk, SMFlow, SMConfig } from 'secureme-sdk';\n\n// Define your flow configuration for both platforms\nconst smFlow: SMFlow = {\n  android: {\n    sdcFront: { enabled: true, showIntro: true, enableFileUpload: true },\n    sdcBack: { enabled: true, enableFileUpload: true, sendFeatureResult: true },\n    pfl: { enabled: true, showIntro: true, sendFeatureResult: true },\n  },\n  ios: {\n    sdcFront: {\n      showIntro: true,\n      enableFileUpload: true,\n      sendFeatureResult: true,\n      localClassification: false,\n    },\n    sdcBack: {\n      showIntro: true,\n      enableFileUpload: true,\n      sendFeatureResult: true,\n    },\n    pfl: {\n      showIntro: true,\n      sendFeatureResult: true,\n    },\n  },\n};\n\n// Define your configuration for both platforms\nconst smConfig: SMConfig = {\n  android: {\n    withPflDetectionDelay: false,\n    pflDelaySecs: 0,\n    sendResults: true,\n  },\n  ios: {\n    pflDetectionDelayEnabled: false,\n    pflDelay: 0.0,\n    sendResults: true,\n    voiceConsentSessionTime: 20,\n  },\n};\n\n// Your workflow data from the API\nconst WORKFLOW_DATA = `{\n  \"sessionId\": \"YOUR_SESSION_ID\",\n  \"response\": {\n    \"session\": \"...\",\n    \"accessToken\": \"...\",\n    \"assets\": [...]\n  },\n  \"statusCode\": 200\n}`;\n\nconst App = () => {\n  const [isLoading, setIsLoading] = useState(true);\n  const [cameraStatus, setCameraStatus] = useState<boolean>(false);\n\n  const requestCameraAccess = async (): Promise<boolean> => {\n    if (Platform.OS === 'android') {\n      try {\n        const granted = await PermissionsAndroid.request(\n          PermissionsAndroid.PERMISSIONS.CAMERA,\n          {\n            title: 'Camera Permission',\n            message: 'This app needs camera access for identity verification.',\n            buttonNeutral: 'Ask Me Later',\n            buttonNegative: 'Cancel',\n            buttonPositive: 'OK',\n          }\n        );\n        return granted === PermissionsAndroid.RESULTS.GRANTED;\n      } catch (err) {\n        console.warn(err);\n        return false;\n      }\n    } else {\n      // iOS - permission handled by SecuremeSdk\n      const hasPermission = await SecuremeSdk.requestCameraPermission();\n      return hasPermission;\n    }\n  };\n\n  useEffect(() => {\n    const setupSDK = async () => {\n      try {\n        console.log('🚀 Starting SDK Setup...');\n\n        const hasPermission = await requestCameraAccess();\n        console.log('📷 Camera Status:', hasPermission);\n        setCameraStatus(hasPermission);\n      } catch (error: any) {\n        console.error('❌ Setup Failed:', error);\n        Alert.alert('Setup Error', error.message || 'Unknown error');\n      } finally {\n        setIsLoading(false);\n      }\n    };\n\n    setupSDK();\n  }, []);\n\n  const handleStartKit = async () => {\n    if (!cameraStatus) {\n      Alert.alert(\n        'Camera Permission Required',\n        'We need camera access to verify your identity.',\n        [\n          { text: 'Cancel', style: 'cancel' },\n          { text: 'Open Settings', onPress: () => Linking.openSettings() },\n        ]\n      );\n      return;\n    }\n\n    try {\n      console.log('📱 Opening SecureMe Kit...');\n      const result = await SecuremeSdk.start(WORKFLOW_DATA, smFlow, smConfig);\n      Alert.alert('Success', 'Verification was successful!');\n      console.log('🏁 Flow finished with result:', result);\n    } catch (error: any) {\n      console.error('❌ Failed to open Kit:', error);\n      Alert.alert('Error', error.message);\n    }\n  };\n\n  return (\n    <SafeAreaView style={styles.container}>\n      <View style={styles.content}>\n        <Text style={styles.title}>SecureMe Integration</Text>\n\n        {isLoading ? (\n          <View>\n            <ActivityIndicator size=\"large\" color=\"#0000ff\" />\n            <Text style={styles.loadingText}>\n              Checking permissions & initializing...\n            </Text>\n          </View>\n        ) : (\n          <View style={styles.infoContainer}>\n            <Text style={styles.statusRow}>\n              Camera: {cameraStatus ? '✅ Allowed' : '❌ Denied'}\n            </Text>\n\n            <View style={styles.buttonContainer}>\n              <Button\n                title=\"Start SecureMe\"\n                onPress={handleStartKit}\n                disabled={!cameraStatus}\n              />\n            </View>\n          </View>\n        )}\n      </View>\n    </SafeAreaView>\n  );\n};\n\nconst styles = StyleSheet.create({\n  container: { flex: 1, backgroundColor: '#F5F5F5' },\n  content: {\n    flex: 1,\n    justifyContent: 'center',\n    alignItems: 'center',\n    padding: 20,\n  },\n  title: { fontSize: 24, fontWeight: 'bold', marginBottom: 30, color: '#333' },\n  loadingText: { marginTop: 10, color: '#666' },\n  infoContainer: { width: '100%', alignItems: 'center' },\n  statusRow: { fontSize: 16, marginBottom: 10, color: '#444' },\n  buttonContainer: { marginTop: 20, width: '100%', marginBottom: 10 },\n});\n\nexport default App;\n```\n\n## API Reference\n\n### Methods\n\n#### `requestCameraPermission(): Promise<boolean>`\n\nRequests camera permission (iOS only - Android handles via `PermissionsAndroid`).\n\n**Returns:** `Promise<boolean>` - `true` if permission granted, `false` otherwise.\n\n```tsx\nconst hasPermission = await SecuremeSdk.requestCameraPermission();\n```\n\n#### `start(workFlowResponse: string, flow: SMFlow, config: SMConfig): Promise<any>`\n\nStarts the SecureMe verification flow.\n\n**Parameters:**\n\n- `workFlowResponse` (string): JSON string containing session data from your backend\n- `flow` (SMFlow): Flow configuration for Android and/or iOS\n- `config` (SMConfig): Additional configuration options for Android and/or iOS\n\n**Returns:** `Promise<any>` - Result of the verification flow\n\n```tsx\nconst result = await SecuremeSdk.start(WORKFLOW_DATA, smFlow, smConfig);\n```\n\n### Types\n\n#### `SMFlow`\n\n```typescript\ninterface SMFlow {\n  android?: AndroidSMFlow;\n  ios?: IOSSMFlow;\n}\n```\n\n#### `SMConfig`\n\n```typescript\ninterface SMConfig {\n  android?: AndroidSMConfig;\n  ios?: IOSSMConfig;\n}\n```\n\nFor detailed type definitions, see [types.ts](src/types.ts).\n\n## Flow Features\n\n### Android Features\n\n- `sdcFront` - Front Document Capture\n- `sdcBack` - Back Document Capture\n- `pfl` - Passive Face Liveness\n- `nfc` - NFC Passport Reading\n- `poa` - Proof of Address\n- `videoSession` - Video Session\n- `voiceConsent` - Voice Consent\n\n### iOS Features\n\n- `sdcFront` - Front Smart Document Capture\n- `sdcBack` - Back Smart Document Capture\n- `pfl` - Passive Face Liveness\n- `vc` - Voice Consent\n- `vs` - Video Session\n- `poa` - Proof of Address\n- `sdcOcr` - OCR Document Capture\n\n## Configuration Options\n\n### Android Config\n\n```typescript\n{\n  pflDelaySecs?: number;\n  sendResults?: boolean;\n  suspiciousConfig?: AndroidSuspiciousConfigType;\n  videoSessionAskUserConsent?: boolean;\n  videoSessionConsentTime?: number;\n  videoSessionIDTime?: number;\n  voiceConsentSessionTime?: number;\n  voiceConsentText?: string;\n  withPflDetectionDelay?: boolean;\n}\n```\n\n### iOS Config\n\n```typescript\n{\n  pflDetectionDelayEnabled?: boolean;\n  pflDelay?: number;\n  sendResults?: boolean;\n  voiceConsentText?: string;\n  voiceConsentSessionTime?: number;\n  videoSessionText?: string;\n  videoSessionIdSessionDuration?: number;\n  videoSessionVoiceSessionDuration?: number;\n}\n```\n\n## Troubleshooting\n\n### iOS\n\n**Issue:** Pod install fails  \n**Solution:** Try `cd ios && pod install --repo-update`\n\n**Issue:** Camera permission not working  \n**Solution:** Ensure `NSCameraUsageDescription` is added to `Info.plist`\n\n### Android\n\n**Issue:** Build fails with dependency conflicts  \n**Solution:** Ensure your `minSdkVersion` is at least 21\n\n**Issue:** Camera permission denied  \n**Solution:** Check that `CAMERA` permission is declared in `AndroidManifest.xml`\n\n## Error Handling\n\nThe SDK can throw the following errors:\n\n### Native Module Errors\n\n- **LinkingError** — thrown when the native module is not properly linked (native binary missing or pods not installed).\n- **PermissionError** — thrown when camera permissions are denied or unavailable.\n- **ValidationError** — thrown when an invalid configuration or workflow payload is provided.\n\n### Session Errors\n\n- **SessionInitError** — failed to initialize session with provided workflow data.\n- **NetworkError** — failed to communicate with backend services or token validation failed.\n\n### Example Error Handling\n\nUse guarded calls and inspect error messages or types to handle specific cases:\n\n```tsx\ntry {\n  const result = await SecuremeSdk.start(WORKFLOW_DATA, smFlow, smConfig);\n  // handle success result\n} catch (error: any) {\n  const msg = error && error.message ? error.message.toLowerCase() : '';\n\n  if (msg.includes('link') || msg.includes('linking')) {\n    // Native linking problems\n    Alert.alert(\n      'Linking Error',\n      'Native module not linked. Run pod install and rebuild.'\n    );\n  } else if (msg.includes('permission')) {\n    // Permission issues\n    Alert.alert(\n      'Permission Required',\n      'Please enable camera access in settings.'\n    );\n  } else if (msg.includes('session') || msg.includes('workflow')) {\n    // Session / workflow validation\n    Alert.alert(\n      'Session Error',\n      'Invalid workflow data or session init failed.'\n    );\n  } else if (msg.includes('network') || msg.includes('timeout')) {\n    // Network problems\n    Alert.alert(\n      'Network Error',\n      'Communication with the backend failed. Try again later.'\n    );\n  } else {\n    // Fallback\n    Alert.alert('Error', error?.message || 'Unknown error occurred');\n  }\n}\n```\n\nNotes:\n\n- Native linking errors typically indicate native code not built/installed. For iOS, run `cd example/ios && pod install` and rebuild.\n- PermissionError means the user denied camera access — prompt to open app settings.\n- ValidationError indicates the provided WORKFLOW data is invalid JSON or missing required fields; validate before calling SDK.\n- Log errors on the native side (Xcode / Logcat) for deeper diagnostics.\n\n## License\n\nMIT\n\n## Support\n\nFor issues and questions, please visit [the repository issues page](https://example.com/repo/issues).\n","readmeFilename":"README.md"}