@hexar/biometric-identity-sdk-react-native 1.0.36 → 1.1.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ProfilePictureCapture.d.ts","sourceRoot":"","sources":["../../src/components/ProfilePictureCapture.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AASxE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAmC,cAAc,EAAsB,MAAM,oCAAoC,CAAC;AAGzJ,MAAM,WAAW,8BAA8B;IAC7C,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,0BAA0B;IACzC,UAAU,EAAE,CAAC,MAAM,EAAE,8BAA8B,KAAK,IAAI,CAAC;IAC7D,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAuMtE,CAAC;AAuCF,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"ProfilePictureCapture.d.ts","sourceRoot":"","sources":["../../src/components/ProfilePictureCapture.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AASxE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAmC,cAAc,EAAsB,MAAM,oCAAoC,CAAC;AAGzJ,MAAM,WAAW,8BAA8B;IAC7C,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,0BAA0B;IACzC,UAAU,EAAE,CAAC,MAAM,EAAE,8BAA8B,KAAK,IAAI,CAAC;IAC7D,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IACzC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CA4KtE,CAAC;AAuCF,eAAe,qBAAqB,CAAC"}
@@ -60,49 +60,28 @@ const ProfilePictureCapture = ({ onComplete, onError, onCancel, theme, language,
60
60
  biometric_identity_sdk_core_1.logger.error('Session ID not available');
61
61
  throw new Error('VALIDATION_ERROR');
62
62
  }
63
- const backendClient = sdk.backendClient;
64
- const apiEndpoint = backendClient.config.apiEndpoint;
65
- const apiKey = backendClient.config.apiKey;
66
- const requestBody = {
67
- session_id: sessionId,
68
- video_frames: videoResult.frames,
69
- video_duration_ms: videoResult.duration,
70
- challenges_completed: videoResult.challengesCompleted || [],
71
- };
72
63
  biometric_identity_sdk_core_1.logger.info('Validating profile picture with backend', {
73
64
  sessionId,
74
65
  framesCount: videoResult.frames.length,
75
66
  duration: videoResult.duration,
76
- apiEndpoint,
77
67
  });
78
- const fullUrl = `${apiEndpoint}/profile/validate-face`;
79
- biometric_identity_sdk_core_1.logger.info('Making request to biometry backend', { url: fullUrl });
80
- const response = await fetch(fullUrl, {
81
- method: 'POST',
82
- headers: {
83
- 'Content-Type': 'application/json',
84
- 'X-API-Key': apiKey,
85
- },
86
- body: JSON.stringify(requestBody),
68
+ const result = await sdk.validateProfilePicture({
69
+ sessionId,
70
+ videoFrames: videoResult.frames,
71
+ videoDurationMs: videoResult.duration,
72
+ challengesCompleted: videoResult.challengesCompleted || [],
87
73
  });
88
- biometric_identity_sdk_core_1.logger.info('Backend response received', { status: response.status, ok: response.ok });
89
- if (!response.ok) {
90
- const errorData = await response.json().catch(() => ({}));
91
- biometric_identity_sdk_core_1.logger.error('Backend validation failed', { status: response.status, error: errorData });
92
- throw new Error('VALIDATION_ERROR');
93
- }
94
- const data = await response.json();
95
74
  biometric_identity_sdk_core_1.logger.info('Profile picture validation result', {
96
- isValid: data.is_valid,
97
- livenessScore: data.liveness_score,
98
- faceDetected: data.face_detected,
75
+ isValid: result.isValid,
76
+ livenessScore: result.livenessScore,
77
+ faceDetected: result.faceDetected,
99
78
  });
100
79
  return {
101
- isValid: data.is_valid,
102
- profilePicture: data.profile_picture,
103
- livenessScore: data.liveness_score,
104
- faceDetected: data.face_detected,
105
- warnings: data.warnings || [],
80
+ isValid: result.isValid,
81
+ profilePicture: result.profilePicture,
82
+ livenessScore: result.livenessScore,
83
+ faceDetected: result.faceDetected,
84
+ warnings: result.warnings || [],
106
85
  };
107
86
  }
108
87
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hexar/biometric-identity-sdk-react-native",
3
- "version": "1.0.36",
3
+ "version": "1.1.1",
4
4
  "description": "React Native wrapper for Biometric Identity SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -59,58 +59,31 @@ export const ProfilePictureCapture: React.FC<ProfilePictureCaptureProps> = ({
59
59
  throw new Error('VALIDATION_ERROR');
60
60
  }
61
61
 
62
- const backendClient = (sdk as any).backendClient;
63
- const apiEndpoint = backendClient.config.apiEndpoint;
64
- const apiKey = backendClient.config.apiKey;
65
-
66
- const requestBody = {
67
- session_id: sessionId,
68
- video_frames: videoResult.frames,
69
- video_duration_ms: videoResult.duration,
70
- challenges_completed: videoResult.challengesCompleted || [],
71
- };
72
-
73
62
  logger.info('Validating profile picture with backend', {
74
63
  sessionId,
75
64
  framesCount: videoResult.frames.length,
76
65
  duration: videoResult.duration,
77
- apiEndpoint,
78
66
  });
79
67
 
80
- const fullUrl = `${apiEndpoint}/profile/validate-face`;
81
- logger.info('Making request to biometry backend', { url: fullUrl });
82
-
83
- const response = await fetch(fullUrl, {
84
- method: 'POST',
85
- headers: {
86
- 'Content-Type': 'application/json',
87
- 'X-API-Key': apiKey,
88
- },
89
- body: JSON.stringify(requestBody),
68
+ const result = await (sdk as any).validateProfilePicture({
69
+ sessionId,
70
+ videoFrames: videoResult.frames,
71
+ videoDurationMs: videoResult.duration,
72
+ challengesCompleted: videoResult.challengesCompleted || [],
90
73
  });
91
74
 
92
- logger.info('Backend response received', { status: response.status, ok: response.ok });
93
-
94
- if (!response.ok) {
95
- const errorData = await response.json().catch(() => ({}));
96
- logger.error('Backend validation failed', { status: response.status, error: errorData });
97
- throw new Error('VALIDATION_ERROR');
98
- }
99
-
100
- const data = await response.json();
101
-
102
75
  logger.info('Profile picture validation result', {
103
- isValid: data.is_valid,
104
- livenessScore: data.liveness_score,
105
- faceDetected: data.face_detected,
76
+ isValid: result.isValid,
77
+ livenessScore: result.livenessScore,
78
+ faceDetected: result.faceDetected,
106
79
  });
107
80
 
108
81
  return {
109
- isValid: data.is_valid,
110
- profilePicture: data.profile_picture,
111
- livenessScore: data.liveness_score,
112
- faceDetected: data.face_detected,
113
- warnings: data.warnings || [],
82
+ isValid: result.isValid,
83
+ profilePicture: result.profilePicture,
84
+ livenessScore: result.livenessScore,
85
+ faceDetected: result.faceDetected,
86
+ warnings: result.warnings || [],
114
87
  };
115
88
  } catch (error: any) {
116
89
  logger.error('Profile picture validation error', error);