@au10tixorg/secureme-sdk 4.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +479 -0
  3. package/android/build.gradle +156 -0
  4. package/android/gradle.properties +4 -0
  5. package/android/src/main/AndroidManifest.xml +6 -0
  6. package/android/src/main/java/com/securemesdk/SecuremeSdkModule.kt +59 -0
  7. package/android/src/main/java/com/securemesdk/SecuremeSdkPackage.kt +17 -0
  8. package/android/src/main/java/com/securemesdk/helpers/ReadableMapExt.kt +51 -0
  9. package/android/src/main/java/com/securemesdk/helpers/SessionParser.kt +21 -0
  10. package/android/src/main/java/com/securemesdk/models/SDKError.kt +24 -0
  11. package/android/src/main/java/com/securemesdk/secureme/SecureMeBottomSheet.kt +308 -0
  12. package/ios/Extensions/DictionaryExtensions.swift +90 -0
  13. package/ios/Extensions/SecureMeExtensions.swift +82 -0
  14. package/ios/Models/SDKError.swift +36 -0
  15. package/ios/Secureme/SecuremeService.swift +261 -0
  16. package/ios/SecuremeSdk-Bridging-Header.h +2 -0
  17. package/ios/SecuremeSdk.m +14 -0
  18. package/ios/SecuremeSdk.swift +102 -0
  19. package/ios/SecuremeSdk.xcodeproj/project.pbxproj +317 -0
  20. package/ios/SecuremeSdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  21. package/lib/commonjs/index.js +103 -0
  22. package/lib/commonjs/index.js.map +1 -0
  23. package/lib/commonjs/package.json +1 -0
  24. package/lib/commonjs/types.js +2 -0
  25. package/lib/commonjs/types.js.map +1 -0
  26. package/lib/module/index.js +85 -0
  27. package/lib/module/index.js.map +1 -0
  28. package/lib/module/types.js +2 -0
  29. package/lib/module/types.js.map +1 -0
  30. package/lib/typescript/index.d.ts +32 -0
  31. package/lib/typescript/index.d.ts.map +1 -0
  32. package/lib/typescript/types.d.ts +95 -0
  33. package/lib/typescript/types.d.ts.map +1 -0
  34. package/package.json +164 -0
  35. package/secureme-sdk.podspec +27 -0
  36. package/src/index.tsx +119 -0
  37. package/src/types.ts +113 -0
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Workspace
3
+ version = "1.0">
4
+ <FileRef
5
+ location = "self:">
6
+ </FileRef>
7
+ </Workspace>
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _exportNames = {
7
+ SecuremeSdk: true
8
+ };
9
+ exports.SecuremeSdk = void 0;
10
+ var _reactNative = require("react-native");
11
+ var _types = require("./types");
12
+ Object.keys(_types).forEach(function (key) {
13
+ if (key === "default" || key === "__esModule") return;
14
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
15
+ if (key in exports && exports[key] === _types[key]) return;
16
+ Object.defineProperty(exports, key, {
17
+ enumerable: true,
18
+ get: function () {
19
+ return _types[key];
20
+ }
21
+ });
22
+ });
23
+ const LINKING_ERROR = `The package 'secureme-sdk' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
24
+ ios: "- You have run 'pod install'\n",
25
+ default: ''
26
+ }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
27
+ const SecuremeSdkModule = _reactNative.NativeModules.SecuremeSdk ? _reactNative.NativeModules.SecuremeSdk : new Proxy({}, {
28
+ get() {
29
+ throw new Error(LINKING_ERROR);
30
+ }
31
+ });
32
+ const NativeSecuremeSdk = SecuremeSdkModule;
33
+ function extractSessionId(workFlowResponse) {
34
+ try {
35
+ const parsed = JSON.parse(workFlowResponse);
36
+ return parsed.sessionId || parsed.response?.sessionId;
37
+ } catch {
38
+ return undefined;
39
+ }
40
+ }
41
+ function validateWorkFlowResponse(workFlowResponse) {
42
+ try {
43
+ JSON.parse(workFlowResponse);
44
+ } catch {
45
+ throw new Error('Invalid workFlowResponse: must be valid JSON');
46
+ }
47
+ }
48
+ function validateFlow(flow) {
49
+ if (Object.keys(flow).length === 0) {
50
+ throw new Error('Flow is empty: must specify at least one platform configuration');
51
+ }
52
+ }
53
+
54
+ /**
55
+ * SecureMe SDK for React Native
56
+ * Provides identity verification functionality for iOS and Android
57
+ */
58
+ const SecuremeSdk = exports.SecuremeSdk = {
59
+ /**
60
+ * Requests camera permission from the native layer (iOS).
61
+ * On Android prefer PermissionsAndroid in the app code.
62
+ *
63
+ * @returns Promise<boolean> - true if permission granted, false otherwise
64
+ *
65
+ * @example
66
+ * const hasPermission = await SecuremeSdk.requestCameraPermission();
67
+ */
68
+ async requestCameraPermission() {
69
+ return NativeSecuremeSdk.requestCameraPermission();
70
+ },
71
+ /**
72
+ * Starts the SecureMe verification flow.
73
+ *
74
+ * @param workFlowResponse - JSON string containing session data
75
+ * @param flow - Flow configuration for Android and/or iOS
76
+ * @param config - Additional SDK configuration options
77
+ * @returns Promise<StartFlowResult> - result object with success/sessionId and optional error
78
+ * @throws {Error} If workFlowResponse is invalid JSON or flow is invalid
79
+ *
80
+ * @example
81
+ * const result = await SecuremeSdk.start(WORKFLOW_DATA, smFlow, smConfig);
82
+ */
83
+ async start(workFlowResponse, flow, config) {
84
+ validateWorkFlowResponse(workFlowResponse);
85
+ validateFlow(flow);
86
+ try {
87
+ const result = await NativeSecuremeSdk.start(workFlowResponse, flow, config);
88
+ const sessionId = extractSessionId(workFlowResponse);
89
+ return {
90
+ success: result,
91
+ sessionId
92
+ };
93
+ } catch (error) {
94
+ const sessionId = extractSessionId(workFlowResponse);
95
+ return {
96
+ success: false,
97
+ sessionId,
98
+ error: error?.message || 'Unknown error'
99
+ };
100
+ }
101
+ }
102
+ };
103
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_types","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","LINKING_ERROR","Platform","select","ios","default","SecuremeSdkModule","NativeModules","SecuremeSdk","Proxy","Error","NativeSecuremeSdk","extractSessionId","workFlowResponse","parsed","JSON","parse","sessionId","response","undefined","validateWorkFlowResponse","validateFlow","flow","length","requestCameraPermission","start","config","result","success","error","message"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAD,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAF,MAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,MAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,MAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAEA,MAAMS,aAAa,GACjB,uEAAuE,GACvEC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,iBAAiB,GAAGC,0BAAa,CAACC,WAAW,GAC/CD,0BAAa,CAACC,WAAW,GACzB,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACET,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIU,KAAK,CAACT,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAWL,MAAMU,iBAAiB,GAAGL,iBAA0C;AAEpE,SAASM,gBAAgBA,CAACC,gBAAwB,EAAsB;EACtE,IAAI;IACF,MAAMC,MAAM,GAAGC,IAAI,CAACC,KAAK,CAACH,gBAAgB,CAAC;IAC3C,OAAOC,MAAM,CAACG,SAAS,IAAIH,MAAM,CAACI,QAAQ,EAAED,SAAS;EACvD,CAAC,CAAC,MAAM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ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+
3
+ import { NativeModules, Platform } from 'react-native';
4
+ export * from './types';
5
+ const LINKING_ERROR = `The package 'secureme-sdk' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
6
+ ios: "- You have run 'pod install'\n",
7
+ default: ''
8
+ }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
9
+ const SecuremeSdkModule = NativeModules.SecuremeSdk ? NativeModules.SecuremeSdk : new Proxy({}, {
10
+ get() {
11
+ throw new Error(LINKING_ERROR);
12
+ }
13
+ });
14
+ const NativeSecuremeSdk = SecuremeSdkModule;
15
+ function extractSessionId(workFlowResponse) {
16
+ try {
17
+ const parsed = JSON.parse(workFlowResponse);
18
+ return parsed.sessionId || parsed.response?.sessionId;
19
+ } catch {
20
+ return undefined;
21
+ }
22
+ }
23
+ function validateWorkFlowResponse(workFlowResponse) {
24
+ try {
25
+ JSON.parse(workFlowResponse);
26
+ } catch {
27
+ throw new Error('Invalid workFlowResponse: must be valid JSON');
28
+ }
29
+ }
30
+ function validateFlow(flow) {
31
+ if (Object.keys(flow).length === 0) {
32
+ throw new Error('Flow is empty: must specify at least one platform configuration');
33
+ }
34
+ }
35
+
36
+ /**
37
+ * SecureMe SDK for React Native
38
+ * Provides identity verification functionality for iOS and Android
39
+ */
40
+ export const SecuremeSdk = {
41
+ /**
42
+ * Requests camera permission from the native layer (iOS).
43
+ * On Android prefer PermissionsAndroid in the app code.
44
+ *
45
+ * @returns Promise<boolean> - true if permission granted, false otherwise
46
+ *
47
+ * @example
48
+ * const hasPermission = await SecuremeSdk.requestCameraPermission();
49
+ */
50
+ async requestCameraPermission() {
51
+ return NativeSecuremeSdk.requestCameraPermission();
52
+ },
53
+ /**
54
+ * Starts the SecureMe verification flow.
55
+ *
56
+ * @param workFlowResponse - JSON string containing session data
57
+ * @param flow - Flow configuration for Android and/or iOS
58
+ * @param config - Additional SDK configuration options
59
+ * @returns Promise<StartFlowResult> - result object with success/sessionId and optional error
60
+ * @throws {Error} If workFlowResponse is invalid JSON or flow is invalid
61
+ *
62
+ * @example
63
+ * const result = await SecuremeSdk.start(WORKFLOW_DATA, smFlow, smConfig);
64
+ */
65
+ async start(workFlowResponse, flow, config) {
66
+ validateWorkFlowResponse(workFlowResponse);
67
+ validateFlow(flow);
68
+ try {
69
+ const result = await NativeSecuremeSdk.start(workFlowResponse, flow, config);
70
+ const sessionId = extractSessionId(workFlowResponse);
71
+ return {
72
+ success: result,
73
+ sessionId
74
+ };
75
+ } catch (error) {
76
+ const sessionId = extractSessionId(workFlowResponse);
77
+ return {
78
+ success: false,
79
+ sessionId,
80
+ error: error?.message || 'Unknown error'
81
+ };
82
+ }
83
+ }
84
+ };
85
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","SecuremeSdkModule","SecuremeSdk","Proxy","get","Error","NativeSecuremeSdk","extractSessionId","workFlowResponse","parsed","JSON","parse","sessionId","response","undefined","validateWorkFlowResponse","validateFlow","flow","Object","keys","length","requestCameraPermission","start","config","result","success","error","message"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAGtD,cAAc,SAAS;AAEvB,MAAMC,aAAa,GACjB,uEAAuE,GACvED,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,iBAAiB,GAAGN,aAAa,CAACO,WAAW,GAC/CP,aAAa,CAACO,WAAW,GACzB,IAAIC,KAA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JM,MACF,CAAC;MACD,MAAMX,SAAS,GAAGL,gBAAgB,CAACC,gBAAgB,CAAC;MAEpD,OAAO;QACLiB,OAAO,EAAED,MAAM;QACfZ;MACF,CAAC;IACH,CAAC,CAAC,OAAOc,KAAU,EAAE;MACnB,MAAMd,SAAS,GAAGL,gBAAgB,CAACC,gBAAgB,CAAC;MAEpD,OAAO;QACLiB,OAAO,EAAE,KAAK;QACdb,SAAS;QACTc,KAAK,EAAEA,KAAK,EAAEC,OAAO,IAAI;MAC3B,CAAC;IACH;EACF;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,32 @@
1
+ import type { SMFlow, SMConfig, StartFlowResult } from './types';
2
+ export * from './types';
3
+ /**
4
+ * SecureMe SDK for React Native
5
+ * Provides identity verification functionality for iOS and Android
6
+ */
7
+ export declare const SecuremeSdk: {
8
+ /**
9
+ * Requests camera permission from the native layer (iOS).
10
+ * On Android prefer PermissionsAndroid in the app code.
11
+ *
12
+ * @returns Promise<boolean> - true if permission granted, false otherwise
13
+ *
14
+ * @example
15
+ * const hasPermission = await SecuremeSdk.requestCameraPermission();
16
+ */
17
+ requestCameraPermission(): Promise<boolean>;
18
+ /**
19
+ * Starts the SecureMe verification flow.
20
+ *
21
+ * @param workFlowResponse - JSON string containing session data
22
+ * @param flow - Flow configuration for Android and/or iOS
23
+ * @param config - Additional SDK configuration options
24
+ * @returns Promise<StartFlowResult> - result object with success/sessionId and optional error
25
+ * @throws {Error} If workFlowResponse is invalid JSON or flow is invalid
26
+ *
27
+ * @example
28
+ * const result = await SecuremeSdk.start(WORKFLOW_DATA, smFlow, smConfig);
29
+ */
30
+ start(workFlowResponse: string, flow: SMFlow, config: SMConfig): Promise<StartFlowResult>;
31
+ };
32
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEjE,cAAc,SAAS,CAAC;AAuDxB;;;GAGG;AACH,eAAO,MAAM,WAAW;IACtB;;;;;;;;OAQG;+BAC8B,OAAO,CAAC,OAAO,CAAC;IAIjD;;;;;;;;;;;OAWG;4BAEiB,MAAM,QAClB,MAAM,UACJ,QAAQ,GACf,OAAO,CAAC,eAAe,CAAC;CA0B5B,CAAC"}
@@ -0,0 +1,95 @@
1
+ export interface AndroidFlowParams {
2
+ enabled?: boolean;
3
+ enableFileUpload?: boolean;
4
+ sendFeatureResult?: boolean;
5
+ showIntro?: boolean;
6
+ }
7
+ export interface AndroidSMFlow {
8
+ afl?: AndroidFlowParams;
9
+ sdcBack?: AndroidFlowParams;
10
+ sdcFront?: AndroidFlowParams;
11
+ nfc?: AndroidFlowParams;
12
+ pfl?: AndroidFlowParams;
13
+ poa?: AndroidFlowParams;
14
+ videoSession?: AndroidFlowParams;
15
+ voiceConsent?: AndroidFlowParams;
16
+ }
17
+ export interface AndroidSuspiciousConfigType {
18
+ checkInterval?: number;
19
+ fastFilterThreshold?: number;
20
+ pixelPerfectThreshold?: number;
21
+ preFilterThreshold?: number;
22
+ stillDeviceThreshold?: number;
23
+ }
24
+ export interface AndroidSMConfig {
25
+ pflDelaySecs?: number;
26
+ sendResults?: boolean;
27
+ suspiciousConfig?: AndroidSuspiciousConfigType;
28
+ videoSessionAskUserConsent?: boolean;
29
+ videoSessionConsentTime?: number;
30
+ videoSessionIDTime?: number;
31
+ voiceConsentSessionTime?: number;
32
+ voiceConsentText?: string;
33
+ withPflDetectionDelay?: boolean;
34
+ }
35
+ export interface IOSSMFlowParams {
36
+ showIntro?: boolean;
37
+ enableFileUpload?: boolean;
38
+ sendFeatureResult?: boolean;
39
+ localClassification?: boolean;
40
+ suspiciousBehaviorConfig?: IOSSuspiciousConfigType;
41
+ }
42
+ export interface IOSSMFlow {
43
+ sdcFront?: IOSSMFlowParams;
44
+ sdcBack?: IOSSMFlowParams;
45
+ pfl?: IOSSMFlowParams;
46
+ vc?: IOSSMFlowParams;
47
+ vs?: IOSSMFlowParams;
48
+ poa?: IOSSMFlowParams;
49
+ sdcOcr?: IOSSMFlowParams;
50
+ }
51
+ export interface IOSSuspiciousConfigType {
52
+ similarityThreshold?: number;
53
+ stillDeviceThreshold?: number;
54
+ rectangleDriftDelta?: number;
55
+ minimumConfidence?: number;
56
+ minimumAspectRatio?: number;
57
+ checkInterval?: number;
58
+ riskThreshold?: number;
59
+ visualSimilarityWeight?: number;
60
+ motionAnomaliesWeight?: number;
61
+ spatialConsistencyWeight?: number;
62
+ temporalPatternsWeight?: number;
63
+ treatMissingSensorsAsSuspicious?: boolean;
64
+ missingSensorRiskScore?: number;
65
+ enableSpatialAnalysis?: boolean;
66
+ spatialSuspicionThreshold?: number;
67
+ spatialGridSize?: number;
68
+ temporalWindowSize?: number;
69
+ timingVarianceThreshold?: number;
70
+ enableDebugLogging?: boolean;
71
+ }
72
+ export interface IOSSMConfig {
73
+ pflDetectionDelayEnabled?: boolean;
74
+ pflDelay?: number;
75
+ sendResults?: boolean;
76
+ voiceConsentText?: string;
77
+ voiceConsentSessionTime?: number;
78
+ videoSessionText?: string;
79
+ videoSessionIdSessionDuration?: number;
80
+ videoSessionVoiceSessionDuration?: number;
81
+ }
82
+ export interface SMFlow {
83
+ android?: AndroidSMFlow;
84
+ ios?: IOSSMFlow;
85
+ }
86
+ export interface SMConfig {
87
+ android?: AndroidSMConfig;
88
+ ios?: IOSSMConfig;
89
+ }
90
+ export interface StartFlowResult {
91
+ success: boolean;
92
+ sessionId?: string;
93
+ error?: string;
94
+ }
95
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"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,CAAC,EAAE,OAAO,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,6BAA6B,CAAC,EAAE,MAAM,CAAC;IACvC,gCAAgC,CAAC,EAAE,MAAM,CAAC;CAC3C;AAID,MAAM,WAAW,MAAM;IACrB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB;AAGD,MAAM,WAAW,QAAQ;IACvB,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,GAAG,CAAC,EAAE,WAAW,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
package/package.json ADDED
@@ -0,0 +1,164 @@
1
+ {
2
+ "name": "@au10tixorg/secureme-sdk",
3
+ "version": "4.7.0",
4
+ "description": "A React Native bridge for implementing Secure.me native functionality",
5
+ "main": "lib/commonjs/index",
6
+ "module": "lib/module/index",
7
+ "types": "lib/typescript/index.d.ts",
8
+ "react-native": "src/index",
9
+ "source": "src/index",
10
+ "files": [
11
+ "src",
12
+ "lib",
13
+ "android",
14
+ "ios",
15
+ "cpp",
16
+ "secureme-sdk.podspec",
17
+ "!lib/typescript/example",
18
+ "!android/build",
19
+ "!android/.gradle",
20
+ "!android/.project",
21
+ "!android/.settings",
22
+ "!ios/build",
23
+ "!**/__tests__",
24
+ "!**/__fixtures__",
25
+ "!**/__mocks__"
26
+ ],
27
+ "scripts": {
28
+ "test": "jest",
29
+ "typescript": "tsc --noEmit",
30
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
31
+ "lint-staged": "lint-staged",
32
+ "prepare": "husky",
33
+ "release": "release-it",
34
+ "example": "yarn --cwd example",
35
+ "pods": "cd example && pod-install --quiet",
36
+ "bootstrap": "yarn example && yarn && yarn pods"
37
+ },
38
+ "keywords": [
39
+ "react-native",
40
+ "ios",
41
+ "android"
42
+ ],
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "https://github.com/AugGlobal/reactnative-secure.me-sdk"
46
+ },
47
+ "author": "AU10TIX Mobile Team <mobile@au10tix.com>",
48
+ "license": "MIT",
49
+ "bugs": {
50
+ "url": "https://github.com/AugGlobal/reactnative-secure.me-sdk/issues"
51
+ },
52
+ "homepage": "https://github.com/AugGlobal/reactnative-secure.me-sdk#readme",
53
+ "publishConfig": {
54
+ "registry": "https://registry.npmjs.org/"
55
+ },
56
+ "devDependencies": {
57
+ "@commitlint/config-conventional": "^20.3.0",
58
+ "@react-native/babel-preset": "^0.82.1",
59
+ "@react-native/eslint-config": "^0.82.1",
60
+ "@release-it/conventional-changelog": "^10.0.4",
61
+ "@types/jest": "^29.5.0",
62
+ "@types/react": "^19.0.0",
63
+ "commitlint": "^20.3.0",
64
+ "eslint": "^8.57.1",
65
+ "eslint-config-prettier": "^9.1.0",
66
+ "eslint-plugin-prettier": "^5.2.0",
67
+ "husky": "^9.1.7",
68
+ "jest": "^29.7.0",
69
+ "lint-staged": "^16.2.7",
70
+ "pod-install": "^1.0.9",
71
+ "prettier": "^3.7.4",
72
+ "react": "19.1.5",
73
+ "react-native": "0.82.1",
74
+ "react-native-builder-bob": "^0.40.17",
75
+ "release-it": "^19.2.2",
76
+ "typescript": "^5.9.3"
77
+ },
78
+ "overrides": {
79
+ "glob": "^11.0.0"
80
+ },
81
+ "peerDependencies": {
82
+ "react": "*",
83
+ "react-native": "*"
84
+ },
85
+ "jest": {
86
+ "preset": "react-native",
87
+ "modulePathIgnorePatterns": [
88
+ "<rootDir>/example/node_modules",
89
+ "<rootDir>/lib/"
90
+ ]
91
+ },
92
+ "lint-staged": {
93
+ "*.{js,jsx,ts,tsx}": [
94
+ "eslint --fix",
95
+ "prettier --write"
96
+ ]
97
+ },
98
+ "commitlint": {
99
+ "extends": [
100
+ "@commitlint/config-conventional"
101
+ ]
102
+ },
103
+ "release-it": {
104
+ "git": {
105
+ "commitMessage": "chore: release ${version}",
106
+ "tagName": "v${version}"
107
+ },
108
+ "npm": {
109
+ "publish": true
110
+ },
111
+ "github": {
112
+ "release": true
113
+ },
114
+ "plugins": {
115
+ "@release-it/conventional-changelog": {
116
+ "preset": "angular"
117
+ }
118
+ }
119
+ },
120
+ "eslintConfig": {
121
+ "root": true,
122
+ "extends": [
123
+ "@react-native",
124
+ "plugin:prettier/recommended"
125
+ ],
126
+ "rules": {
127
+ "prettier/prettier": [
128
+ "error",
129
+ {
130
+ "quoteProps": "consistent",
131
+ "singleQuote": true,
132
+ "tabWidth": 2,
133
+ "trailingComma": "es5",
134
+ "useTabs": false
135
+ }
136
+ ]
137
+ }
138
+ },
139
+ "eslintIgnore": [
140
+ "node_modules/",
141
+ "lib/"
142
+ ],
143
+ "prettier": {
144
+ "quoteProps": "consistent",
145
+ "singleQuote": true,
146
+ "tabWidth": 2,
147
+ "trailingComma": "es5",
148
+ "useTabs": false
149
+ },
150
+ "react-native-builder-bob": {
151
+ "source": "src",
152
+ "output": "lib",
153
+ "targets": [
154
+ "commonjs",
155
+ "module",
156
+ [
157
+ "typescript",
158
+ {
159
+ "project": "tsconfig.build.json"
160
+ }
161
+ ]
162
+ ]
163
+ }
164
+ }
@@ -0,0 +1,27 @@
1
+ require "json"
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
+
5
+ Pod::Spec.new do |s|
6
+ s.name = "secureme-sdk"
7
+ s.version = package["version"]
8
+ s.summary = package["description"]
9
+ s.homepage = package["homepage"]
10
+ s.license = package["license"]
11
+ s.authors = package["author"]
12
+
13
+ s.platforms = { :ios => "10.0" }
14
+ s.source = { :git => "https://example.com/repo.git", :tag => "#{s.version}" }
15
+
16
+ s.source_files = "ios/**/*.{h,m,mm,swift}"
17
+
18
+ s.dependency "React-Core"
19
+ # Au10tix
20
+ s.dependency 'Au10tixSecureMeKit', "4.7.0"
21
+ s.dependency 'Au10tixPassiveFaceLivenessUI', "4.7.0"
22
+ s.dependency 'Au10tixProofOfAddressUI', "4.7.0"
23
+ s.dependency 'Au10tixSmartDocumentCaptureUI', "4.7.0"
24
+ s.dependency 'Au10tixVoiceConsentUI', "4.7.0"
25
+ s.dependency 'Au10tixNFCPassportUI', "4.7.0"
26
+ s.dependency 'Au10tixLocalDataInferenceKit', "4.7.0"
27
+ end
package/src/index.tsx ADDED
@@ -0,0 +1,119 @@
1
+ import { NativeModules, Platform } from 'react-native';
2
+ import type { SMFlow, SMConfig, StartFlowResult } from './types';
3
+
4
+ export * from './types';
5
+
6
+ const LINKING_ERROR =
7
+ `The package 'secureme-sdk' doesn't seem to be linked. Make sure: \n\n` +
8
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
9
+ '- You rebuilt the app after installing the package\n' +
10
+ '- You are not using Expo Go\n';
11
+
12
+ const SecuremeSdkModule = NativeModules.SecuremeSdk
13
+ ? NativeModules.SecuremeSdk
14
+ : new Proxy(
15
+ {},
16
+ {
17
+ get() {
18
+ throw new Error(LINKING_ERROR);
19
+ },
20
+ }
21
+ );
22
+
23
+ type NativeSecuremeSdkType = {
24
+ requestCameraPermission(): Promise<boolean>;
25
+ start(
26
+ workFlowResponse: string,
27
+ flow: SMFlow,
28
+ config: SMConfig
29
+ ): Promise<boolean>;
30
+ };
31
+
32
+ const NativeSecuremeSdk = SecuremeSdkModule as NativeSecuremeSdkType;
33
+
34
+ function extractSessionId(workFlowResponse: string): string | undefined {
35
+ try {
36
+ const parsed = JSON.parse(workFlowResponse);
37
+ return parsed.sessionId || parsed.response?.sessionId;
38
+ } catch {
39
+ return undefined;
40
+ }
41
+ }
42
+
43
+ function validateWorkFlowResponse(workFlowResponse: string): void {
44
+ try {
45
+ JSON.parse(workFlowResponse);
46
+ } catch {
47
+ throw new Error('Invalid workFlowResponse: must be valid JSON');
48
+ }
49
+ }
50
+
51
+ function validateFlow(flow: SMFlow): void {
52
+ if (Object.keys(flow).length === 0) {
53
+ throw new Error(
54
+ 'Flow is empty: must specify at least one platform configuration'
55
+ );
56
+ }
57
+ }
58
+
59
+ /**
60
+ * SecureMe SDK for React Native
61
+ * Provides identity verification functionality for iOS and Android
62
+ */
63
+ export const SecuremeSdk = {
64
+ /**
65
+ * Requests camera permission from the native layer (iOS).
66
+ * On Android prefer PermissionsAndroid in the app code.
67
+ *
68
+ * @returns Promise<boolean> - true if permission granted, false otherwise
69
+ *
70
+ * @example
71
+ * const hasPermission = await SecuremeSdk.requestCameraPermission();
72
+ */
73
+ async requestCameraPermission(): Promise<boolean> {
74
+ return NativeSecuremeSdk.requestCameraPermission();
75
+ },
76
+
77
+ /**
78
+ * Starts the SecureMe verification flow.
79
+ *
80
+ * @param workFlowResponse - JSON string containing session data
81
+ * @param flow - Flow configuration for Android and/or iOS
82
+ * @param config - Additional SDK configuration options
83
+ * @returns Promise<StartFlowResult> - result object with success/sessionId and optional error
84
+ * @throws {Error} If workFlowResponse is invalid JSON or flow is invalid
85
+ *
86
+ * @example
87
+ * const result = await SecuremeSdk.start(WORKFLOW_DATA, smFlow, smConfig);
88
+ */
89
+ async start(
90
+ workFlowResponse: string,
91
+ flow: SMFlow,
92
+ config: SMConfig
93
+ ): Promise<StartFlowResult> {
94
+ validateWorkFlowResponse(workFlowResponse);
95
+ validateFlow(flow);
96
+
97
+ try {
98
+ const result = await NativeSecuremeSdk.start(
99
+ workFlowResponse,
100
+ flow,
101
+ config
102
+ );
103
+ const sessionId = extractSessionId(workFlowResponse);
104
+
105
+ return {
106
+ success: result,
107
+ sessionId,
108
+ };
109
+ } catch (error: any) {
110
+ const sessionId = extractSessionId(workFlowResponse);
111
+
112
+ return {
113
+ success: false,
114
+ sessionId,
115
+ error: error?.message || 'Unknown error',
116
+ };
117
+ }
118
+ },
119
+ };