attestid_js_sdk 0.1.11 → 0.1.13

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.
@@ -68,10 +68,35 @@ interface LivenessCredentials {
68
68
  expiration: string;
69
69
  region: string;
70
70
  }
71
+ /**
72
+ * Whether to ask for the back of a national ID / driver's licence. Each
73
+ * company decides on the AttestID dashboard (Settings):
74
+ * - 'off' — don't ask; a back sent anyway is ignored by the API.
75
+ * - 'optional' — ask, and let the user skip it.
76
+ * - 'required' — the back must be sent and its MRZ must be readable,
77
+ * otherwise POST /kyc/start fails with
78
+ * document_back_required / document_back_unreadable.
79
+ * Never applies to passports.
80
+ */
81
+ type DocumentBackPolicy = 'off' | 'optional' | 'required';
82
+ /** What the document capture should ask for, as set by the company. */
83
+ interface CaptureSettings {
84
+ document_back: DocumentBackPolicy;
85
+ }
71
86
  interface StartKYCOptions {
72
87
  userId: string;
73
88
  idType: IdType;
74
89
  idPhoto: File | Blob;
90
+ /**
91
+ * Optional photo of the BACK of a national ID / driver's licence. Many
92
+ * cards (ICAO 9303 TD1) print their machine-readable zone (MRZ) on the back;
93
+ * when this photo carries one, the API cross-checks its date of birth and
94
+ * expiry against the front and rejects a mismatch (document_sides_mismatch).
95
+ * A back with no MRZ is ignored, never a failure. Not accepted with
96
+ * idType 'passport'. Use checkBackPhotoQuality() to tell the user whether
97
+ * an MRZ was found before sending it.
98
+ */
99
+ idPhotoBack?: File | Blob;
75
100
  /**
76
101
  * Stated purpose for biometric processing. Defaults to 'identity_verification'.
77
102
  * One of: 'identity_verification', 'kyc_onboarding', 'kyc_refresh',
@@ -219,6 +244,12 @@ declare class AttestID {
219
244
  * TypeScript's type check are still rejected here at runtime.
220
245
  */
221
246
  startVerification(options: StartKYCOptions): Promise<StartKYCResponse>;
247
+ /**
248
+ * The company's capture settings, set on the AttestID dashboard. Read
249
+ * `document_back` before the document step to know whether to ask for the
250
+ * back of a national ID / driver's licence (see DocumentBackPolicy).
251
+ */
252
+ getCaptureSettings(userId: string): Promise<CaptureSettings>;
222
253
  /**
223
254
  * Fetch temporary AWS credentials and the Cognito identity pool ID from the
224
255
  * backend. Call this alongside startVerification() for the same userId to
@@ -68,10 +68,35 @@ interface LivenessCredentials {
68
68
  expiration: string;
69
69
  region: string;
70
70
  }
71
+ /**
72
+ * Whether to ask for the back of a national ID / driver's licence. Each
73
+ * company decides on the AttestID dashboard (Settings):
74
+ * - 'off' — don't ask; a back sent anyway is ignored by the API.
75
+ * - 'optional' — ask, and let the user skip it.
76
+ * - 'required' — the back must be sent and its MRZ must be readable,
77
+ * otherwise POST /kyc/start fails with
78
+ * document_back_required / document_back_unreadable.
79
+ * Never applies to passports.
80
+ */
81
+ type DocumentBackPolicy = 'off' | 'optional' | 'required';
82
+ /** What the document capture should ask for, as set by the company. */
83
+ interface CaptureSettings {
84
+ document_back: DocumentBackPolicy;
85
+ }
71
86
  interface StartKYCOptions {
72
87
  userId: string;
73
88
  idType: IdType;
74
89
  idPhoto: File | Blob;
90
+ /**
91
+ * Optional photo of the BACK of a national ID / driver's licence. Many
92
+ * cards (ICAO 9303 TD1) print their machine-readable zone (MRZ) on the back;
93
+ * when this photo carries one, the API cross-checks its date of birth and
94
+ * expiry against the front and rejects a mismatch (document_sides_mismatch).
95
+ * A back with no MRZ is ignored, never a failure. Not accepted with
96
+ * idType 'passport'. Use checkBackPhotoQuality() to tell the user whether
97
+ * an MRZ was found before sending it.
98
+ */
99
+ idPhotoBack?: File | Blob;
75
100
  /**
76
101
  * Stated purpose for biometric processing. Defaults to 'identity_verification'.
77
102
  * One of: 'identity_verification', 'kyc_onboarding', 'kyc_refresh',
@@ -219,6 +244,12 @@ declare class AttestID {
219
244
  * TypeScript's type check are still rejected here at runtime.
220
245
  */
221
246
  startVerification(options: StartKYCOptions): Promise<StartKYCResponse>;
247
+ /**
248
+ * The company's capture settings, set on the AttestID dashboard. Read
249
+ * `document_back` before the document step to know whether to ask for the
250
+ * back of a national ID / driver's licence (see DocumentBackPolicy).
251
+ */
252
+ getCaptureSettings(userId: string): Promise<CaptureSettings>;
222
253
  /**
223
254
  * Fetch temporary AWS credentials and the Cognito identity pool ID from the
224
255
  * backend. Call this alongside startVerification() for the same userId to