@kernaq/verify-react-native 1.0.4 → 2.0.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.
package/src/types.ts CHANGED
@@ -1,15 +1,22 @@
1
1
  /**
2
- * @kernaq/verify-react-native — public types
2
+ * @kernaq/verify-react-native — public types (v2)
3
3
  */
4
4
 
5
5
  export type VerifyStep =
6
6
  | 'intro'
7
- | 'document'
7
+ | 'doc-front'
8
+ | 'doc-back'
8
9
  | 'selfie'
9
10
  | 'liveness'
10
11
  | 'processing'
11
12
  | 'result'
12
13
 
14
+ /** Which capture steps to include. Default: all three. */
15
+ export type VerifyStepName = 'document' | 'selfie' | 'liveness'
16
+
17
+ /** Liveness challenge tasks */
18
+ export type LivenessTask = 'blink' | 'turn-left' | 'turn-right' | 'nod' | 'open-mouth'
19
+
13
20
  export type DocumentType =
14
21
  | 'national_id'
15
22
  | 'passport'
@@ -29,21 +36,14 @@ export interface VerifyResult {
29
36
  }
30
37
 
31
38
  export interface VerifyTheme {
32
- /** Primary accent colour. Default: #111827 */
33
39
  accentColor?: string
34
- /** Modal background. Default: #ffffff */
35
40
  backgroundColor?: string
36
- /** Primary text colour. Default: #111827 */
37
41
  textColor?: string
38
- /** Subtle text colour. Default: #6b7280 */
39
42
  subtextColor?: string
40
- /** Border/divider colour. Default: #e5e7eb */
41
43
  borderColor?: string
42
- /** Card/surface colour. Default: #f9fafb */
43
44
  cardColor?: string
44
- /** Border radius for buttons and cards. Default: 12 */
45
45
  borderRadius?: number
46
- /** 'light' | 'dark' — overrides bg/text when set */
46
+ /** 'light' | 'dark' */
47
47
  mode?: 'light' | 'dark'
48
48
  }
49
49
 
@@ -51,74 +51,50 @@ export interface VerifyLocale {
51
51
  intro_title: string
52
52
  intro_body: string
53
53
  intro_cta: string
54
- doc_title: string
55
- doc_instruction: string
54
+ doc_front_title: string
55
+ doc_front_instruction: string
56
+ doc_back_title: string
57
+ doc_back_instruction: string
56
58
  doc_capture_btn: string
57
59
  doc_retake_btn: string
58
- doc_next_btn: string
59
60
  selfie_title: string
60
61
  selfie_instruction: string
61
- selfie_capture_btn: string
62
- selfie_retake_btn: string
63
- selfie_next_btn: string
64
62
  liveness_title: string
65
- liveness_instruction: string
66
- liveness_start_btn: string
67
- liveness_recording: string
63
+ liveness_ready: string
64
+ liveness_task_prefix: string
65
+ liveness_complete: string
68
66
  processing_title: string
69
- processing_subtitle: string
70
67
  result_pass_title: string
71
68
  result_pass_body: string
72
69
  result_fail_title: string
73
70
  result_fail_body: string
74
71
  result_review_title: string
75
72
  result_review_body: string
76
- result_retry_btn: string
77
73
  error_camera_denied: string
74
+ error_blur: string
78
75
  error_quality: string
79
76
  error_network: string
80
77
  }
81
78
 
82
79
  export interface VerifyConfig {
83
- /**
84
- * Your Kernaq publishable API key (k_test_... or k_live_...).
85
- * For production use a backend proxy and pass backendUrl instead.
86
- */
87
80
  apiKey?: string
88
-
89
- /**
90
- * URL of your backend proxy that forwards to the Kernaq Identity API.
91
- * POST /verify with multipart/form-data.
92
- */
93
81
  backendUrl?: string
94
-
95
- /** Document types the user can select. Default: ['national_id', 'passport'] */
96
- documentTypes?: DocumentType[]
97
-
98
- /** Country code (ISO 3166-1 alpha-3). Default: 'KEN' */
82
+ /** Single document type the developer specifies. Default: 'national_id' */
83
+ documentType?: DocumentType
99
84
  country?: string
100
-
101
- /** Your internal reference ID for this user/session */
102
85
  reference?: string
103
-
104
- /** Use sandbox mode — no billing, test responses */
105
86
  sandbox?: boolean
106
-
107
- /** Liveness recording duration in ms. Default: 3000 */
108
87
  livenessDuration?: number
109
-
110
- /** Theming */
88
+ /** Number of liveness tasks. Default: 2 */
89
+ livenessTaskCount?: number
90
+ /**
91
+ * Which steps to include. Default: all three.
92
+ * @example steps={['selfie', 'liveness']}
93
+ */
94
+ steps?: VerifyStepName[]
111
95
  theme?: VerifyTheme
112
-
113
- /** Override any displayed string */
114
96
  locale?: Partial<VerifyLocale>
115
-
116
- /** Called when the user dismisses without completing */
117
97
  onCancel?: () => void
118
-
119
- /** Called when verification is complete */
120
98
  onComplete?: (result: VerifyResult) => void
121
-
122
- /** Called on unrecoverable error */
123
99
  onError?: (error: { code: string; message: string }) => void
124
100
  }