@trustchex/react-native-sdk 1.483.4 → 1.484.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.
package/README.md CHANGED
@@ -151,11 +151,19 @@ module.exports = {
151
151
  ### Basic
152
152
 
153
153
  ```tsx
154
- import Trustchex from '@trustchex/react-native-sdk';
154
+ import Trustchex, { type DocumentReadResult } from '@trustchex/react-native-sdk';
155
155
 
156
156
  <Trustchex
157
157
  baseUrl="https://your-server.com"
158
158
  sessionId="session-id"
159
+ onDocumentRead={(result: DocumentReadResult) => {
160
+ const { document } = result;
161
+ console.log(document.documentType); // "P" | "I"
162
+ console.log(document.lastName); // "MÜLLER"
163
+ console.log(document.firstName); // "JÜRGEN KARL"
164
+ console.log(document.dateOfBirth); // "1985-03-10" (ISO 8601)
165
+ console.log(document.dateOfExpiry); // "2030-11-05" (ISO 8601)
166
+ }}
159
167
  onCompleted={() => console.log('Completed')}
160
168
  onError={(error) => console.error(error)}
161
169
  />
@@ -210,14 +218,15 @@ const [baseUrl, sessionId] = handleDeepLink({
210
218
  ## API
211
219
 
212
220
  | Prop | Type | Description |
213
- |------|------|-------------|
221
+ | ---- | ---- | ----------- |
214
222
  | `baseUrl` | `string?` | Server URL |
215
223
  | `sessionId` | `string?` | Verification session ID |
216
224
  | `branding` | `object?` | Theme colors and logo |
217
225
  | `locale` | `'en' \| 'tr'?` | UI language |
218
226
  | `enableAnalytics` | `boolean?` | Enable analytics (default: `true`) |
219
- | `onCompleted` | `function?` | Success callback |
220
- | `onError` | `function?` | Error callback |
227
+ | `onDocumentRead` | `(result: DocumentReadResult) => void` | Called when document is read via NFC or OCR |
228
+ | `onCompleted` | `() => void` | Success callback |
229
+ | `onError` | `(error) => void` | Error callback |
221
230
 
222
231
  ## Analytics
223
232
 
@@ -229,7 +238,7 @@ The SDK includes **privacy-compliant analytics** that respects GDPR, KVKK, and P
229
238
  - ✅ **Data anonymization** - Device identifiers excluded
230
239
  - ✅ **Right to deletion** - Users can clear their data
231
240
 
232
- ### Usage
241
+ ### Analytics Configuration
233
242
 
234
243
  Analytics is enabled by default. To customize:
235
244
 
@@ -279,7 +279,7 @@ export class MRZInfo extends AbstractLDSInfo {
279
279
  * @deprecated Class will become immutable
280
280
  */
281
281
  setPrimaryIdentifier(primaryIdentifier) {
282
- this.primaryIdentifier = MRZInfo.trimTrailingFillerChars(primaryIdentifier).replace('<', ' ');
282
+ this.primaryIdentifier = MRZInfo.trimTrailingFillerChars(primaryIdentifier).replace(/</g, ' ');
283
283
  this.checkDigit();
284
284
  }
285
285
 
@@ -772,11 +772,11 @@ export class MRZInfo extends AbstractLDSInfo {
772
772
  const delimIndex = mrzNameString.indexOf('<<');
773
773
  if (delimIndex < 0) {
774
774
  /* Only a primary identifier. */
775
- this.primaryIdentifier = MRZInfo.trimTrailingFillerChars(mrzNameString).replace('<', ' ');
775
+ this.primaryIdentifier = MRZInfo.trimTrailingFillerChars(mrzNameString).replace(/</g, ' ');
776
776
  this.secondaryIdentifier = '';
777
777
  return;
778
778
  }
779
- this.primaryIdentifier = MRZInfo.trimTrailingFillerChars(mrzNameString.substring(0, delimIndex)).replace('<', ' ');
779
+ this.primaryIdentifier = MRZInfo.trimTrailingFillerChars(mrzNameString.substring(0, delimIndex)).replace(/</g, ' ');
780
780
  const rest = mrzNameString.substring(delimIndex + 2);
781
781
  this.readSecondaryIdentifiers(rest);
782
782
  }
@@ -787,7 +787,7 @@ export class MRZInfo extends AbstractLDSInfo {
787
787
  * @param secondaryIdentifier the new secondary identifier
788
788
  */
789
789
  readSecondaryIdentifiers(secondaryIdentifier) {
790
- this.secondaryIdentifier = MRZInfo.trimTrailingFillerChars(secondaryIdentifier).replace('<', ' ');
790
+ this.secondaryIdentifier = MRZInfo.trimTrailingFillerChars(secondaryIdentifier).replace(/</g, ' ');
791
791
  }
792
792
 
793
793
  /**
@@ -2,4 +2,4 @@
2
2
 
3
3
  // This file is auto-generated. Do not edit manually.
4
4
  // Version is synced from package.json during build.
5
- export const SDK_VERSION = '1.483.4';
5
+ export const SDK_VERSION = '1.484.0';
@@ -1,2 +1,2 @@
1
- export declare const SDK_VERSION = "1.483.4";
1
+ export declare const SDK_VERSION = "1.484.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trustchex/react-native-sdk",
3
- "version": "1.483.4",
3
+ "version": "1.484.0",
4
4
  "description": "Trustchex mobile app react native SDK for android or ios devices",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -304,7 +304,7 @@ export class MRZInfo extends AbstractLDSInfo {
304
304
  public setPrimaryIdentifier(primaryIdentifier: string): void {
305
305
  this.primaryIdentifier = MRZInfo.trimTrailingFillerChars(
306
306
  primaryIdentifier
307
- ).replace('<', ' ');
307
+ ).replace(/</g, ' ');
308
308
  this.checkDigit();
309
309
  }
310
310
 
@@ -916,13 +916,13 @@ export class MRZInfo extends AbstractLDSInfo {
916
916
  /* Only a primary identifier. */
917
917
  this.primaryIdentifier = MRZInfo.trimTrailingFillerChars(
918
918
  mrzNameString
919
- ).replace('<', ' ');
919
+ ).replace(/</g, ' ');
920
920
  this.secondaryIdentifier = '';
921
921
  return;
922
922
  }
923
923
  this.primaryIdentifier = MRZInfo.trimTrailingFillerChars(
924
924
  mrzNameString.substring(0, delimIndex)
925
- ).replace('<', ' ');
925
+ ).replace(/</g, ' ');
926
926
  const rest = mrzNameString.substring(delimIndex + 2);
927
927
  this.readSecondaryIdentifiers(rest);
928
928
  }
@@ -935,7 +935,7 @@ export class MRZInfo extends AbstractLDSInfo {
935
935
  private readSecondaryIdentifiers(secondaryIdentifier: string): void {
936
936
  this.secondaryIdentifier = MRZInfo.trimTrailingFillerChars(
937
937
  secondaryIdentifier
938
- ).replace('<', ' ');
938
+ ).replace(/</g, ' ');
939
939
  }
940
940
 
941
941
  /**
package/src/version.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  // This file is auto-generated. Do not edit manually.
2
2
  // Version is synced from package.json during build.
3
- export const SDK_VERSION = '1.483.4';
3
+ export const SDK_VERSION = '1.484.0';