@kwik-id/sdk-react-native 0.0.0-stage → 0.1.0-alpha.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 (269) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +81 -2
  3. package/app.plugin.js +40 -0
  4. package/lib/commonjs/api/api-client.js +213 -0
  5. package/lib/commonjs/api/api-client.js.map +1 -0
  6. package/lib/commonjs/api/api-error.js +29 -0
  7. package/lib/commonjs/api/api-error.js.map +1 -0
  8. package/lib/commonjs/api/index.js +33 -0
  9. package/lib/commonjs/api/index.js.map +1 -0
  10. package/lib/commonjs/api/upload.js +74 -0
  11. package/lib/commonjs/api/upload.js.map +1 -0
  12. package/lib/commonjs/camera/camera-view.js +227 -0
  13. package/lib/commonjs/camera/camera-view.js.map +1 -0
  14. package/lib/commonjs/camera/index.js +20 -0
  15. package/lib/commonjs/camera/index.js.map +1 -0
  16. package/lib/commonjs/camera/photo-capture.js +50 -0
  17. package/lib/commonjs/camera/photo-capture.js.map +1 -0
  18. package/lib/commonjs/crypto/fingerprint.js +43 -0
  19. package/lib/commonjs/crypto/fingerprint.js.map +1 -0
  20. package/lib/commonjs/crypto/hmac.js +150 -0
  21. package/lib/commonjs/crypto/hmac.js.map +1 -0
  22. package/lib/commonjs/crypto/index.js +39 -0
  23. package/lib/commonjs/crypto/index.js.map +1 -0
  24. package/lib/commonjs/crypto/session-manager.js +173 -0
  25. package/lib/commonjs/crypto/session-manager.js.map +1 -0
  26. package/lib/commonjs/i18n/en.js +297 -0
  27. package/lib/commonjs/i18n/en.js.map +1 -0
  28. package/lib/commonjs/i18n/fr.js +294 -0
  29. package/lib/commonjs/i18n/fr.js.map +1 -0
  30. package/lib/commonjs/i18n/index.js +34 -0
  31. package/lib/commonjs/i18n/index.js.map +1 -0
  32. package/lib/commonjs/i18n/locale.js +20 -0
  33. package/lib/commonjs/i18n/locale.js.map +1 -0
  34. package/lib/commonjs/i18n/translator.js +37 -0
  35. package/lib/commonjs/i18n/translator.js.map +1 -0
  36. package/lib/commonjs/index.js +187 -0
  37. package/lib/commonjs/index.js.map +1 -0
  38. package/lib/commonjs/lib/device-detector.js +34 -0
  39. package/lib/commonjs/lib/device-detector.js.map +1 -0
  40. package/lib/commonjs/lib/event-emitter.js +85 -0
  41. package/lib/commonjs/lib/event-emitter.js.map +1 -0
  42. package/lib/commonjs/lib/index.js +63 -0
  43. package/lib/commonjs/lib/index.js.map +1 -0
  44. package/lib/commonjs/lib/kwik-id-rn-sdk.js +156 -0
  45. package/lib/commonjs/lib/kwik-id-rn-sdk.js.map +1 -0
  46. package/lib/commonjs/lib/verification-machine.js +276 -0
  47. package/lib/commonjs/lib/verification-machine.js.map +1 -0
  48. package/lib/commonjs/package.json +1 -0
  49. package/lib/commonjs/types/events.js +6 -0
  50. package/lib/commonjs/types/events.js.map +1 -0
  51. package/lib/commonjs/types/index.js +2 -0
  52. package/lib/commonjs/types/index.js.map +1 -0
  53. package/lib/commonjs/ui/components/KwikIDVerificationModal.js +407 -0
  54. package/lib/commonjs/ui/components/KwikIDVerificationModal.js.map +1 -0
  55. package/lib/commonjs/ui/components/screens.js +338 -0
  56. package/lib/commonjs/ui/components/screens.js.map +1 -0
  57. package/lib/commonjs/ui/context/kwik-id-provider.js +52 -0
  58. package/lib/commonjs/ui/context/kwik-id-provider.js.map +1 -0
  59. package/lib/commonjs/ui/hooks/use-kwik-verification.js +77 -0
  60. package/lib/commonjs/ui/hooks/use-kwik-verification.js.map +1 -0
  61. package/lib/commonjs/ui/index.js +33 -0
  62. package/lib/commonjs/ui/index.js.map +1 -0
  63. package/lib/module/api/api-client.js +208 -0
  64. package/lib/module/api/api-client.js.map +1 -0
  65. package/lib/module/api/api-error.js +24 -0
  66. package/lib/module/api/api-error.js.map +1 -0
  67. package/lib/module/api/index.js +6 -0
  68. package/lib/module/api/index.js.map +1 -0
  69. package/lib/module/api/upload.js +68 -0
  70. package/lib/module/api/upload.js.map +1 -0
  71. package/lib/module/camera/camera-view.js +222 -0
  72. package/lib/module/camera/camera-view.js.map +1 -0
  73. package/lib/module/camera/index.js +5 -0
  74. package/lib/module/camera/index.js.map +1 -0
  75. package/lib/module/camera/photo-capture.js +45 -0
  76. package/lib/module/camera/photo-capture.js.map +1 -0
  77. package/lib/module/crypto/fingerprint.js +37 -0
  78. package/lib/module/crypto/fingerprint.js.map +1 -0
  79. package/lib/module/crypto/hmac.js +143 -0
  80. package/lib/module/crypto/hmac.js.map +1 -0
  81. package/lib/module/crypto/index.js +6 -0
  82. package/lib/module/crypto/index.js.map +1 -0
  83. package/lib/module/crypto/session-manager.js +169 -0
  84. package/lib/module/crypto/session-manager.js.map +1 -0
  85. package/lib/module/i18n/en.js +293 -0
  86. package/lib/module/i18n/en.js.map +1 -0
  87. package/lib/module/i18n/fr.js +290 -0
  88. package/lib/module/i18n/fr.js.map +1 -0
  89. package/lib/module/i18n/index.js +11 -0
  90. package/lib/module/i18n/index.js.map +1 -0
  91. package/lib/module/i18n/locale.js +15 -0
  92. package/lib/module/i18n/locale.js.map +1 -0
  93. package/lib/module/i18n/translator.js +34 -0
  94. package/lib/module/i18n/translator.js.map +1 -0
  95. package/lib/module/index.js +30 -0
  96. package/lib/module/index.js.map +1 -0
  97. package/lib/module/lib/device-detector.js +26 -0
  98. package/lib/module/lib/device-detector.js.map +1 -0
  99. package/lib/module/lib/event-emitter.js +80 -0
  100. package/lib/module/lib/event-emitter.js.map +1 -0
  101. package/lib/module/lib/index.js +6 -0
  102. package/lib/module/lib/index.js.map +1 -0
  103. package/lib/module/lib/kwik-id-rn-sdk.js +150 -0
  104. package/lib/module/lib/kwik-id-rn-sdk.js.map +1 -0
  105. package/lib/module/lib/verification-machine.js +268 -0
  106. package/lib/module/lib/verification-machine.js.map +1 -0
  107. package/lib/module/package.json +1 -0
  108. package/lib/module/types/events.js +4 -0
  109. package/lib/module/types/events.js.map +1 -0
  110. package/lib/module/types/index.js +2 -0
  111. package/lib/module/types/index.js.map +1 -0
  112. package/lib/module/ui/components/KwikIDVerificationModal.js +402 -0
  113. package/lib/module/ui/components/KwikIDVerificationModal.js.map +1 -0
  114. package/lib/module/ui/components/screens.js +328 -0
  115. package/lib/module/ui/components/screens.js.map +1 -0
  116. package/lib/module/ui/context/kwik-id-provider.js +46 -0
  117. package/lib/module/ui/context/kwik-id-provider.js.map +1 -0
  118. package/lib/module/ui/hooks/use-kwik-verification.js +72 -0
  119. package/lib/module/ui/hooks/use-kwik-verification.js.map +1 -0
  120. package/lib/module/ui/index.js +6 -0
  121. package/lib/module/ui/index.js.map +1 -0
  122. package/lib/typescript/commonjs/api/api-client.d.ts +82 -0
  123. package/lib/typescript/commonjs/api/api-client.d.ts.map +1 -0
  124. package/lib/typescript/commonjs/api/api-error.d.ts +13 -0
  125. package/lib/typescript/commonjs/api/api-error.d.ts.map +1 -0
  126. package/lib/typescript/commonjs/api/index.d.ts +6 -0
  127. package/lib/typescript/commonjs/api/index.d.ts.map +1 -0
  128. package/lib/typescript/commonjs/api/upload.d.ts +19 -0
  129. package/lib/typescript/commonjs/api/upload.d.ts.map +1 -0
  130. package/lib/typescript/commonjs/camera/camera-view.d.ts +25 -0
  131. package/lib/typescript/commonjs/camera/camera-view.d.ts.map +1 -0
  132. package/lib/typescript/commonjs/camera/index.d.ts +5 -0
  133. package/lib/typescript/commonjs/camera/index.d.ts.map +1 -0
  134. package/lib/typescript/commonjs/camera/photo-capture.d.ts +9 -0
  135. package/lib/typescript/commonjs/camera/photo-capture.d.ts.map +1 -0
  136. package/lib/typescript/commonjs/crypto/fingerprint.d.ts +3 -0
  137. package/lib/typescript/commonjs/crypto/fingerprint.d.ts.map +1 -0
  138. package/lib/typescript/commonjs/crypto/hmac.d.ts +18 -0
  139. package/lib/typescript/commonjs/crypto/hmac.d.ts.map +1 -0
  140. package/lib/typescript/commonjs/crypto/index.d.ts +4 -0
  141. package/lib/typescript/commonjs/crypto/index.d.ts.map +1 -0
  142. package/lib/typescript/commonjs/crypto/session-manager.d.ts +27 -0
  143. package/lib/typescript/commonjs/crypto/session-manager.d.ts.map +1 -0
  144. package/lib/typescript/commonjs/i18n/en.d.ts +291 -0
  145. package/lib/typescript/commonjs/i18n/en.d.ts.map +1 -0
  146. package/lib/typescript/commonjs/i18n/fr.d.ts +6 -0
  147. package/lib/typescript/commonjs/i18n/fr.d.ts.map +1 -0
  148. package/lib/typescript/commonjs/i18n/index.d.ts +10 -0
  149. package/lib/typescript/commonjs/i18n/index.d.ts.map +1 -0
  150. package/lib/typescript/commonjs/i18n/locale.d.ts +4 -0
  151. package/lib/typescript/commonjs/i18n/locale.d.ts.map +1 -0
  152. package/lib/typescript/commonjs/i18n/translator.d.ts +15 -0
  153. package/lib/typescript/commonjs/i18n/translator.d.ts.map +1 -0
  154. package/lib/typescript/commonjs/index.d.ts +24 -0
  155. package/lib/typescript/commonjs/index.d.ts.map +1 -0
  156. package/lib/typescript/commonjs/lib/device-detector.d.ts +5 -0
  157. package/lib/typescript/commonjs/lib/device-detector.d.ts.map +1 -0
  158. package/lib/typescript/commonjs/lib/event-emitter.d.ts +19 -0
  159. package/lib/typescript/commonjs/lib/event-emitter.d.ts.map +1 -0
  160. package/lib/typescript/commonjs/lib/index.d.ts +5 -0
  161. package/lib/typescript/commonjs/lib/index.d.ts.map +1 -0
  162. package/lib/typescript/commonjs/lib/kwik-id-rn-sdk.d.ts +43 -0
  163. package/lib/typescript/commonjs/lib/kwik-id-rn-sdk.d.ts.map +1 -0
  164. package/lib/typescript/commonjs/lib/verification-machine.d.ts +78 -0
  165. package/lib/typescript/commonjs/lib/verification-machine.d.ts.map +1 -0
  166. package/lib/typescript/commonjs/package.json +1 -0
  167. package/lib/typescript/commonjs/types/events.d.ts +94 -0
  168. package/lib/typescript/commonjs/types/events.d.ts.map +1 -0
  169. package/lib/typescript/commonjs/types/index.d.ts +242 -0
  170. package/lib/typescript/commonjs/types/index.d.ts.map +1 -0
  171. package/lib/typescript/commonjs/ui/components/KwikIDVerificationModal.d.ts +21 -0
  172. package/lib/typescript/commonjs/ui/components/KwikIDVerificationModal.d.ts.map +1 -0
  173. package/lib/typescript/commonjs/ui/components/screens.d.ts +46 -0
  174. package/lib/typescript/commonjs/ui/components/screens.d.ts.map +1 -0
  175. package/lib/typescript/commonjs/ui/context/kwik-id-provider.d.ts +19 -0
  176. package/lib/typescript/commonjs/ui/context/kwik-id-provider.d.ts.map +1 -0
  177. package/lib/typescript/commonjs/ui/hooks/use-kwik-verification.d.ts +29 -0
  178. package/lib/typescript/commonjs/ui/hooks/use-kwik-verification.d.ts.map +1 -0
  179. package/lib/typescript/commonjs/ui/index.d.ts +7 -0
  180. package/lib/typescript/commonjs/ui/index.d.ts.map +1 -0
  181. package/lib/typescript/module/api/api-client.d.ts +82 -0
  182. package/lib/typescript/module/api/api-client.d.ts.map +1 -0
  183. package/lib/typescript/module/api/api-error.d.ts +13 -0
  184. package/lib/typescript/module/api/api-error.d.ts.map +1 -0
  185. package/lib/typescript/module/api/index.d.ts +6 -0
  186. package/lib/typescript/module/api/index.d.ts.map +1 -0
  187. package/lib/typescript/module/api/upload.d.ts +19 -0
  188. package/lib/typescript/module/api/upload.d.ts.map +1 -0
  189. package/lib/typescript/module/camera/camera-view.d.ts +25 -0
  190. package/lib/typescript/module/camera/camera-view.d.ts.map +1 -0
  191. package/lib/typescript/module/camera/index.d.ts +5 -0
  192. package/lib/typescript/module/camera/index.d.ts.map +1 -0
  193. package/lib/typescript/module/camera/photo-capture.d.ts +9 -0
  194. package/lib/typescript/module/camera/photo-capture.d.ts.map +1 -0
  195. package/lib/typescript/module/crypto/fingerprint.d.ts +3 -0
  196. package/lib/typescript/module/crypto/fingerprint.d.ts.map +1 -0
  197. package/lib/typescript/module/crypto/hmac.d.ts +18 -0
  198. package/lib/typescript/module/crypto/hmac.d.ts.map +1 -0
  199. package/lib/typescript/module/crypto/index.d.ts +4 -0
  200. package/lib/typescript/module/crypto/index.d.ts.map +1 -0
  201. package/lib/typescript/module/crypto/session-manager.d.ts +27 -0
  202. package/lib/typescript/module/crypto/session-manager.d.ts.map +1 -0
  203. package/lib/typescript/module/i18n/en.d.ts +291 -0
  204. package/lib/typescript/module/i18n/en.d.ts.map +1 -0
  205. package/lib/typescript/module/i18n/fr.d.ts +6 -0
  206. package/lib/typescript/module/i18n/fr.d.ts.map +1 -0
  207. package/lib/typescript/module/i18n/index.d.ts +10 -0
  208. package/lib/typescript/module/i18n/index.d.ts.map +1 -0
  209. package/lib/typescript/module/i18n/locale.d.ts +4 -0
  210. package/lib/typescript/module/i18n/locale.d.ts.map +1 -0
  211. package/lib/typescript/module/i18n/translator.d.ts +15 -0
  212. package/lib/typescript/module/i18n/translator.d.ts.map +1 -0
  213. package/lib/typescript/module/index.d.ts +24 -0
  214. package/lib/typescript/module/index.d.ts.map +1 -0
  215. package/lib/typescript/module/lib/device-detector.d.ts +5 -0
  216. package/lib/typescript/module/lib/device-detector.d.ts.map +1 -0
  217. package/lib/typescript/module/lib/event-emitter.d.ts +19 -0
  218. package/lib/typescript/module/lib/event-emitter.d.ts.map +1 -0
  219. package/lib/typescript/module/lib/index.d.ts +5 -0
  220. package/lib/typescript/module/lib/index.d.ts.map +1 -0
  221. package/lib/typescript/module/lib/kwik-id-rn-sdk.d.ts +43 -0
  222. package/lib/typescript/module/lib/kwik-id-rn-sdk.d.ts.map +1 -0
  223. package/lib/typescript/module/lib/verification-machine.d.ts +78 -0
  224. package/lib/typescript/module/lib/verification-machine.d.ts.map +1 -0
  225. package/lib/typescript/module/package.json +1 -0
  226. package/lib/typescript/module/types/events.d.ts +94 -0
  227. package/lib/typescript/module/types/events.d.ts.map +1 -0
  228. package/lib/typescript/module/types/index.d.ts +242 -0
  229. package/lib/typescript/module/types/index.d.ts.map +1 -0
  230. package/lib/typescript/module/ui/components/KwikIDVerificationModal.d.ts +21 -0
  231. package/lib/typescript/module/ui/components/KwikIDVerificationModal.d.ts.map +1 -0
  232. package/lib/typescript/module/ui/components/screens.d.ts +46 -0
  233. package/lib/typescript/module/ui/components/screens.d.ts.map +1 -0
  234. package/lib/typescript/module/ui/context/kwik-id-provider.d.ts +19 -0
  235. package/lib/typescript/module/ui/context/kwik-id-provider.d.ts.map +1 -0
  236. package/lib/typescript/module/ui/hooks/use-kwik-verification.d.ts +29 -0
  237. package/lib/typescript/module/ui/hooks/use-kwik-verification.d.ts.map +1 -0
  238. package/lib/typescript/module/ui/index.d.ts +7 -0
  239. package/lib/typescript/module/ui/index.d.ts.map +1 -0
  240. package/package.json +121 -3
  241. package/src/api/api-client.ts +319 -0
  242. package/src/api/api-error.ts +28 -0
  243. package/src/api/index.ts +12 -0
  244. package/src/api/upload.ts +87 -0
  245. package/src/camera/camera-view.tsx +217 -0
  246. package/src/camera/index.ts +4 -0
  247. package/src/camera/photo-capture.ts +58 -0
  248. package/src/crypto/fingerprint.ts +46 -0
  249. package/src/crypto/hmac.ts +172 -0
  250. package/src/crypto/index.ts +3 -0
  251. package/src/crypto/session-manager.ts +200 -0
  252. package/src/i18n/en.ts +315 -0
  253. package/src/i18n/fr.ts +325 -0
  254. package/src/i18n/index.ts +9 -0
  255. package/src/i18n/locale.ts +15 -0
  256. package/src/i18n/translator.ts +37 -0
  257. package/src/index.ts +102 -0
  258. package/src/lib/device-detector.ts +32 -0
  259. package/src/lib/event-emitter.ts +90 -0
  260. package/src/lib/index.ts +15 -0
  261. package/src/lib/kwik-id-rn-sdk.ts +160 -0
  262. package/src/lib/verification-machine.ts +273 -0
  263. package/src/types/events.ts +75 -0
  264. package/src/types/index.ts +309 -0
  265. package/src/ui/components/KwikIDVerificationModal.tsx +450 -0
  266. package/src/ui/components/screens.tsx +283 -0
  267. package/src/ui/context/kwik-id-provider.tsx +72 -0
  268. package/src/ui/hooks/use-kwik-verification.ts +121 -0
  269. package/src/ui/index.ts +9 -0
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Pure reducer for the RN verification flow.
3
+ *
4
+ * Adapted from the web SDK's KYCModalFlow SubStep machine. No React / no native
5
+ * dependency, so it is fully unit-testable. The selfie branch folds the web's
6
+ * `camera-selfie` into a single `liveness` step (align → passive/active → capture).
7
+ */
8
+ import type { CaptureAsset, CaptureSlot, CaptureType, DocumentType, LivenessResult, VerificationOutcome, VerificationSubStep } from "../types";
9
+ export interface MachineContext {
10
+ documentType: DocumentType | null;
11
+ front?: CaptureAsset;
12
+ back?: CaptureAsset;
13
+ selfie?: CaptureAsset;
14
+ livenessResult?: LivenessResult;
15
+ /** 0..100 upload/submit progress shown on the processing screen. */
16
+ uploadProgress: number;
17
+ uploadStage: CaptureType | "submitting" | null;
18
+ outcome?: VerificationOutcome;
19
+ error?: string;
20
+ }
21
+ export interface MachineState {
22
+ step: VerificationSubStep;
23
+ context: MachineContext;
24
+ }
25
+ export interface MachineOptions {
26
+ /** When launched as the mobile redeemer of a desktop handoff. */
27
+ hasHandoffCode?: boolean;
28
+ }
29
+ export type MachineEvent = {
30
+ t: "NEXT";
31
+ } | {
32
+ t: "BACK";
33
+ } | {
34
+ t: "SELECT_DOC";
35
+ doc: DocumentType;
36
+ } | {
37
+ t: "CAPTURED";
38
+ slot: CaptureSlot;
39
+ asset: CaptureAsset;
40
+ } | {
41
+ t: "RETAKE";
42
+ slot: CaptureSlot;
43
+ } | {
44
+ t: "HANDOFF_REDEEMED";
45
+ }
46
+ /** `result` is omitted until on-device liveness ships (Phase 2). */
47
+ | {
48
+ t: "LIVENESS_DONE";
49
+ result?: LivenessResult;
50
+ selfie: CaptureAsset;
51
+ } | {
52
+ t: "PROGRESS";
53
+ stage: MachineContext["uploadStage"];
54
+ value: number;
55
+ } | {
56
+ t: "SUBMITTED";
57
+ jobId: string;
58
+ } | {
59
+ t: "CANCEL";
60
+ } | {
61
+ t: "FAILED";
62
+ error: string;
63
+ }
64
+ /** Back to a fresh intro, e.g. when the modal closes so the next run starts clean. */
65
+ | {
66
+ t: "RESET";
67
+ };
68
+ export declare function needsBackImage(doc: DocumentType | null): boolean;
69
+ export declare function initialState(): MachineState;
70
+ /** Progress-bar percentage (0..100) for the current step. */
71
+ export declare function getStepProgress(state: MachineState): number;
72
+ /**
73
+ * Upload/submit progress banding (matches web performVerification):
74
+ * front 0–30, back 30–45, selfie 45–70 (or 30–55 without back), submit 80, done 100.
75
+ */
76
+ export declare function computeUploadProgress(stage: MachineContext["uploadStage"], pct: number, hasBack: boolean): number;
77
+ export declare function reducer(state: MachineState, event: MachineEvent, options?: MachineOptions): MachineState;
78
+ //# sourceMappingURL=verification-machine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verification-machine.d.ts","sourceRoot":"","sources":["../../../../src/lib/verification-machine.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EACR,YAAY,EACZ,WAAW,EACX,WAAW,EACX,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACtB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,cAAc;IAC3B,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,oEAAoE;IACpE,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,WAAW,GAAG,YAAY,GAAG,IAAI,CAAC;IAC/C,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,mBAAmB,CAAC;IAC1B,OAAO,EAAE,cAAc,CAAC;CAC3B;AAED,MAAM,WAAW,cAAc;IAC3B,iEAAiE;IACjE,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,MAAM,YAAY,GAClB;IAAE,CAAC,EAAE,MAAM,CAAA;CAAE,GACb;IAAE,CAAC,EAAE,MAAM,CAAA;CAAE,GACb;IAAE,CAAC,EAAE,YAAY,CAAC;IAAC,G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"}
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Event vocabulary for @kwik-id/sdk-react-native.
3
+ *
4
+ * Mirrors the portable subset of the web SDK's KwikIdEvents — DOM/Blob/MediaStream
5
+ * payloads are replaced with RN-native equivalents (CaptureAsset, FaceSignals).
6
+ */
7
+ import type { CaptureAsset, CaptureType, Challenge, ChallengeResult, FaceSignals, LivenessMode, LivenessResult, PassiveLivenessResult, Session, VerificationResult } from "./index";
8
+ export interface KwikIdEvents {
9
+ "session:created": Session;
10
+ "session:expired": {
11
+ sessionId: string;
12
+ };
13
+ "session:refreshed": Session;
14
+ "camera:ready": void;
15
+ "camera:error": {
16
+ error: Error;
17
+ recoverable: boolean;
18
+ };
19
+ "camera:permission_denied": {
20
+ canAskAgain: boolean;
21
+ };
22
+ "face:detected": FaceSignals;
23
+ "face:lost": void;
24
+ "face:aligned": void;
25
+ "face:misaligned": {
26
+ reason: string;
27
+ };
28
+ "liveness:starting": {
29
+ mode: LivenessMode;
30
+ };
31
+ "liveness:challenge": Challenge;
32
+ "liveness:challenge_result": ChallengeResult;
33
+ "liveness:passive_result": PassiveLivenessResult;
34
+ "liveness:complete": LivenessResult;
35
+ "liveness:failed": {
36
+ reason: string;
37
+ };
38
+ "capture:starting": {
39
+ type: CaptureType;
40
+ };
41
+ "capture:complete": {
42
+ type: CaptureType;
43
+ asset: CaptureAsset;
44
+ };
45
+ "capture:failed": {
46
+ type: CaptureType;
47
+ error: Error;
48
+ };
49
+ "upload:starting": {
50
+ type: CaptureType;
51
+ };
52
+ "upload:progress": {
53
+ type: CaptureType;
54
+ progress: number;
55
+ };
56
+ "upload:complete": {
57
+ type: CaptureType;
58
+ uploadId: string;
59
+ };
60
+ "upload:failed": {
61
+ type: CaptureType;
62
+ error: Error;
63
+ retryable: boolean;
64
+ };
65
+ "verification:submitting": void;
66
+ "verification:submitted": {
67
+ jobId: string;
68
+ };
69
+ "verification:processing": {
70
+ jobId: string;
71
+ progress?: number;
72
+ };
73
+ "verification:complete": VerificationResult;
74
+ "verification:failed": {
75
+ error: Error;
76
+ jobId?: string;
77
+ };
78
+ "handoff:redeemed": {
79
+ jobId: string;
80
+ };
81
+ "handoff:error": {
82
+ error: Error;
83
+ };
84
+ ready: void;
85
+ error: {
86
+ code: string;
87
+ message: string;
88
+ recoverable: boolean;
89
+ };
90
+ destroy: void;
91
+ }
92
+ export type KwikIdEventName = keyof KwikIdEvents;
93
+ export type KwikIdEventHandler<T extends KwikIdEventName> = (data: KwikIdEvents[T]) => void;
94
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/types/events.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EACR,YAAY,EACZ,WAAW,EACX,SAAS,EACT,eAAe,EACf,WAAW,EACX,YAAY,EACZ,cAAc,EACd,qBAAqB,EACrB,OAAO,EACP,kBAAkB,EACrB,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,YAAY;IAEzB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iBAAiB,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IACzC,mBAAmB,EAAE,OAAO,CAAC;IAG7B,cAAc,EAAE,IAAI,CAAC;IACrB,cAAc,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,WAAW,EAAE,OAAO,CAAA;KAAE,CAAC;IACvD,0BAA0B,EAAE;QAAE,WAAW,EAAE,OAAO,CAAA;KAAE,CAAC;IAGrD,eAAe,EAAE,WAAW,CAAC;IAC7B,WAAW,EAAE,IAAI,CAAC;IAClB,cAAc,EAAE,IAAI,CAAC;IACrB,iBAAiB,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAGtC,mBAAmB,EAAE;QAAE,IAAI,EAAE,YAAY,CAAA;KAAE,CAAC;IAC5C,oBAAoB,EAAE,SAAS,CAAC;IAChC,2BAA2B,EAAE,eAAe,CAAC;IA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AI,CAAC;IACZ,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,OAAO,CAAA;KAAE,CAAC;IAC/D,OAAO,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,MAAM,eAAe,GAAG,MAAM,YAAY,CAAC;AAEjD,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,eAAe,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC"}
@@ -0,0 +1,242 @@
1
+ /**
2
+ * Canonical types for @kwik-id/sdk-react-native.
3
+ *
4
+ * These are a self-contained, RN-native mirror of the KwikId protocol vocabulary.
5
+ * They are kept structurally compatible with `@kwik-id/sdk-core` via the build-excluded
6
+ * assertions in `./__compat__`. This package has NO runtime dependency on `@kwik-id/*`.
7
+ */
8
+ export interface KwikIdTheme {
9
+ primary?: string;
10
+ accent?: string;
11
+ background?: string;
12
+ foreground?: string;
13
+ error?: string;
14
+ success?: string;
15
+ }
16
+ export type Locale = "en" | "fr";
17
+ export type LivenessMode = "passive" | "active" | "hybrid";
18
+ export interface KwikIdConfig {
19
+ /** Session token obtained from your backend (POST /api/v1/sessions). */
20
+ clientSecret: string;
21
+ /** Base URL for API calls (defaults to production). */
22
+ baseUrl?: string;
23
+ /** Display name shown in the verification UI. */
24
+ appName?: string;
25
+ /** Theme customization. */
26
+ theme?: KwikIdTheme;
27
+ /** Locale for UI text. */
28
+ locale?: Locale;
29
+ /**
30
+ * Liveness mode; overrides the session config when set.
31
+ * @deprecated Not yet supported: ignored until on-device liveness lands (Phase 2).
32
+ */
33
+ livenessMode?: LivenessMode;
34
+ /** Request timeout in milliseconds. */
35
+ timeout?: number;
36
+ /** Enable debug logging. */
37
+ debug?: boolean;
38
+ }
39
+ export type DocumentType = "id_card" | "passport" | "drivers_license" | "voters_card" | "residence_permit";
40
+ export type CaptureType = "document_front" | "document_back" | "selfie" | "liveness_frame";
41
+ /** RN capture descriptor — replaces the web SDK's DOM File/Blob. */
42
+ export interface CaptureAsset {
43
+ uri: string;
44
+ name: string;
45
+ type: string;
46
+ width: number;
47
+ height: number;
48
+ }
49
+ export interface CaptureMetadata {
50
+ timestamp: number;
51
+ resolution: {
52
+ width: number;
53
+ height: number;
54
+ };
55
+ facingMode: "user" | "environment";
56
+ deviceId?: string;
57
+ qualityScore?: number;
58
+ faceDetected?: boolean;
59
+ }
60
+ export type QualityGuidance = "move_to_brighter_area" | "reduce_brightness" | "hold_still" | "move_closer" | "move_back" | "center_face" | "only_one_face";
61
+ export interface QualityCheckResult {
62
+ passed: boolean;
63
+ value: number;
64
+ threshold: number;
65
+ issue?: string;
66
+ }
67
+ export interface QualityResult {
68
+ passed: boolean;
69
+ timestamp: number;
70
+ checks: {
71
+ luminance: QualityCheckResult & {
72
+ issue?: "too_dark" | "too_bright";
73
+ };
74
+ blur: QualityCheckResult & {
75
+ issue?: "too_blurry";
76
+ };
77
+ resolution: QualityCheckResult & {
78
+ width: number;
79
+ height: number;
80
+ };
81
+ face?: QualityCheckResult & {
82
+ count: number;
83
+ size?: number;
84
+ issue?: "no_face" | "multiple_faces" | "face_too_small";
85
+ };
86
+ };
87
+ guidance: QualityGuidance[];
88
+ }
89
+ export interface FacePose {
90
+ yaw: number;
91
+ pitch: number;
92
+ roll: number;
93
+ }
94
+ /**
95
+ * Normalized per-frame face signals produced by the ML Kit frame processor.
96
+ * All probabilities are 0..1; angles are degrees. This is the single source the
97
+ * alignment + liveness detectors consume (replaces the web SDK's Landmark[] probing).
98
+ */
99
+ export interface FaceSignals {
100
+ faceCount: number;
101
+ /** Face bounding-box area as a fraction of the frame area. */
102
+ bboxRatio: number;
103
+ /** Normalized horizontal offset of the face center from frame center (-1..1). */
104
+ centerOffsetX: number;
105
+ /** Normalized vertical offset of the face center from frame center (-1..1). */
106
+ centerOffsetY: number;
107
+ yaw: number;
108
+ pitch: number;
109
+ roll: number;
110
+ leftEyeOpen: number;
111
+ rightEyeOpen: number;
112
+ smiling: number;
113
+ /** Mouth open ratio (0..1); -1 when unavailable on the device. */
114
+ mouthOpenRatio: number;
115
+ confidence: number;
116
+ }
117
+ export type ChallengeType = "blink" | "smile" | "turn_left" | "turn_right" | "nod" | "open_mouth";
118
+ export interface Challenge {
119
+ type: ChallengeType;
120
+ instruction: string;
121
+ timeoutMs: number;
122
+ requiredCount?: number;
123
+ targetAngle?: number;
124
+ }
125
+ export interface ChallengeResult {
126
+ challenge: Challenge;
127
+ passed: boolean;
128
+ confidence: number;
129
+ completedAt?: number;
130
+ }
131
+ export interface PassiveLivenessResult {
132
+ passed: boolean;
133
+ confidence: number;
134
+ checks: {
135
+ microMovement: {
136
+ passed: boolean;
137
+ detected: boolean;
138
+ };
139
+ naturalBlink: {
140
+ passed: boolean;
141
+ detected: boolean;
142
+ };
143
+ textureAnalysis: {
144
+ passed: boolean;
145
+ score: number;
146
+ };
147
+ };
148
+ spoofType?: "screen" | "print" | "mask" | "unknown";
149
+ }
150
+ export interface LivenessResult {
151
+ passed: boolean;
152
+ mode: LivenessMode;
153
+ passiveResult?: PassiveLivenessResult;
154
+ challenges?: ChallengeResult[];
155
+ confidence: number;
156
+ }
157
+ export interface DeviceFingerprint {
158
+ platform: string;
159
+ osVersion: string;
160
+ deviceModel: string;
161
+ screenResolution: string;
162
+ timezone: string;
163
+ language: string;
164
+ fingerprintHash: string;
165
+ }
166
+ export interface Session {
167
+ sessionId: string;
168
+ clientSecret: string;
169
+ jobId?: string;
170
+ expiresAt: Date;
171
+ deviceFingerprint: string;
172
+ nonce: string;
173
+ sequenceNumber: number;
174
+ }
175
+ export interface SecurePayload {
176
+ sessionId: string;
177
+ timestamp: number;
178
+ nonce: string;
179
+ sequenceNumber: number;
180
+ signature: string;
181
+ deviceFingerprint: string;
182
+ data: unknown;
183
+ }
184
+ export interface VerificationScores {
185
+ documentQuality: number;
186
+ documentAuthenticity: number;
187
+ faceMatch: number;
188
+ liveness: number;
189
+ }
190
+ export interface ExtractedData {
191
+ documentType: string;
192
+ documentNumber?: string;
193
+ fullName?: string;
194
+ firstName?: string;
195
+ lastName?: string;
196
+ dateOfBirth?: string;
197
+ expiryDate?: string;
198
+ issuingCountry?: string;
199
+ nationality?: string;
200
+ gender?: string;
201
+ address?: string;
202
+ [key: string]: string | undefined;
203
+ }
204
+ export interface VerificationResult {
205
+ jobId: string;
206
+ status: "verified" | "rejected" | "manual_review" | "pending" | "processing";
207
+ overallScore: number;
208
+ scores: VerificationScores;
209
+ extractedData?: ExtractedData;
210
+ rejectionReasons?: string[];
211
+ errorDetails?: {
212
+ document: string;
213
+ errorCode: string;
214
+ errorMessage: string;
215
+ };
216
+ timestamps: {
217
+ submitted: string;
218
+ completed?: string;
219
+ };
220
+ referenceId: string;
221
+ }
222
+ /** The terminal outcome surfaced to the host app from `start()`. */
223
+ export interface VerificationOutcome {
224
+ status: "submitted" | "cancelled" | "error";
225
+ jobId?: string;
226
+ error?: Error;
227
+ }
228
+ export interface SessionInfo {
229
+ sessionId: string;
230
+ expiresAt: string;
231
+ orgName?: string;
232
+ orgLogoUrl?: string;
233
+ config: {
234
+ documentTypes: DocumentType[];
235
+ livenessMode: LivenessMode;
236
+ maxRetries: number;
237
+ };
238
+ }
239
+ export type VerificationSubStep = "intro" | "handoff-redeem" | "document-type" | "prepare-front" | "camera-front" | "confirm-front" | "prepare-back" | "camera-back" | "confirm-back" | "prepare-selfie" | "liveness" | "confirm-selfie" | "processing" | "result";
240
+ export type CaptureSlot = "front" | "back" | "selfie";
241
+ export type { KwikIdEvents, KwikIdEventName, KwikIdEventHandler } from "./events";
242
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,WAAW,WAAW;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAA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E,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE;QACJ,aAAa,EAAE,YAAY,EAAE,CAAC;QAC9B,YAAY,EAAE,YAAY,CAAC;QAC3B,UAAU,EAAE,MAAM,CAAC;KACtB,CAAC;CACL;AAMD,MAAM,MAAM,mBAAmB,GACzB,OAAO,GACP,gBAAgB,GAChB,eAAe,GACf,eAAe,GACf,cAAc,GACd,eAAe,GACf,cAAc,GACd,aAAa,GACb,cAAc,GACd,gBAAgB,GAChB,UAAU,GACV,gBAAgB,GAChB,YAAY,GACZ,QAAQ,CAAC;AAEf,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEtD,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { DocumentType, KwikIdTheme, Locale, VerificationOutcome } from "../../types";
2
+ export interface KwikIDVerificationModalProps {
3
+ visible: boolean;
4
+ clientSecret: string;
5
+ baseUrl?: string;
6
+ appName?: string;
7
+ theme?: KwikIdTheme;
8
+ /** UI language; defaults to the device language ('fr' for French, else 'en'). */
9
+ locale?: Locale;
10
+ /** Restrict the selectable document types (intersected with the session config). */
11
+ documentTypes?: DocumentType[];
12
+ /** Skip the Expo Go runtime guard (tests only). */
13
+ skipRuntimeCheck?: boolean;
14
+ onSubmitted?: (data: {
15
+ jobId: string;
16
+ }) => void;
17
+ onComplete: (outcome: VerificationOutcome) => void;
18
+ onClose?: () => void;
19
+ }
20
+ export declare function KwikIDVerificationModal(props: KwikIDVerificationModalProps): import("react/jsx-runtime").JSX.Element;
21
+ //# sourceMappingURL=KwikIDVerificationModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KwikIDVerificationModal.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/KwikIDVerificationModal.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAER,YAAY,EACZ,WAAW,EACX,MAAM,EAEN,mBAAmB,EACtB,MAAM,aAAa,CAAC;AAWrB,MAAM,WAAW,4BAA4B;IACzC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oFAAoF;IACpF,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,mDAAmD;IACnD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAChD,UAAU,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACnD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAgBD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,2CAsV1E"}
@@ -0,0 +1,46 @@
1
+ import type { Translate } from "../../i18n";
2
+ import type { CaptureAsset, DocumentType } from "../../types";
3
+ export interface Theme {
4
+ primary: string;
5
+ background: string;
6
+ foreground: string;
7
+ }
8
+ export declare function IntroScreen({ orgName, onNext, theme, t, }: {
9
+ orgName?: string;
10
+ onNext: () => void;
11
+ theme: Theme;
12
+ t: Translate;
13
+ }): import("react/jsx-runtime").JSX.Element;
14
+ export declare function DocumentTypeScreen({ allowed, onSelect, theme, t, }: {
15
+ allowed: DocumentType[];
16
+ onSelect: (doc: DocumentType) => void;
17
+ theme: Theme;
18
+ t: Translate;
19
+ }): import("react/jsx-runtime").JSX.Element;
20
+ export declare function PrepareScreen({ kind, onNext, theme, t, }: {
21
+ kind: "front" | "back" | "selfie";
22
+ onNext: () => void;
23
+ theme: Theme;
24
+ t: Translate;
25
+ }): import("react/jsx-runtime").JSX.Element;
26
+ export declare function ConfirmScreen({ asset, onConfirm, onRetake, theme, t, }: {
27
+ asset: CaptureAsset;
28
+ onConfirm: () => void;
29
+ onRetake: () => void;
30
+ theme: Theme;
31
+ t: Translate;
32
+ }): import("react/jsx-runtime").JSX.Element;
33
+ export declare function ProcessingScreen({ progress, stage, theme, t, }: {
34
+ progress: number;
35
+ stage: string | null;
36
+ theme: Theme;
37
+ t: Translate;
38
+ }): import("react/jsx-runtime").JSX.Element;
39
+ export declare function ResultScreen({ success, message, onDone, theme, t, }: {
40
+ success: boolean;
41
+ message: string;
42
+ onDone: () => void;
43
+ theme: Theme;
44
+ t: Translate;
45
+ }): import("react/jsx-runtime").JSX.Element;
46
+ //# sourceMappingURL=screens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screens.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/screens.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE9D,MAAM,WAAW,KAAK;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACtB;AA8BD,wBAAgB,WAAW,CAAC,EACxB,OAAO,EACP,MAAM,EACN,KAAK,EACL,CAAC,GACJ,EAAE;IACC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,CAAC,EAAE,SAAS,CAAC;CAChB,2CAYA;AAED,wBAAgB,kBAAkB,CAAC,EAC/B,OAAO,EACP,QAAQ,EACR,KAAK,EACL,CAAC,GACJ,EAAE;IACC,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,QAAQ,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,IAAI,CAAC;IACtC,KAAK,EAAE,KAAK,CAAC;IACb,CAAC,EAAE,SAAS,CAAC;CAChB,2CAqBA;AAWD,wBAAgB,aAAa,CAAC,EAC1B,IAAI,EACJ,MAAM,EACN,KAAK,EACL,CAAC,GACJ,EAAE;IACC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;IAClC,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,CAAC,EAAE,SAAS,CAAC;CAChB,2CAUA;AAED,wBAAgB,aAAa,CAAC,EAC1B,KAAK,EACL,SAAS,EACT,QAAQ,EACR,KAAK,EACL,CAAC,GACJ,EAAE;IACC,KAAK,EAAE,YAAY,CAAC;IACpB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,CAAC,EAAE,SAAS,CAAC;CAChB,2CAgBA;AAED,wBAAgB,gBAAgB,CAAC,EAC7B,QAAQ,EACR,KAAK,EACL,KAAK,EACL,CAAC,GACJ,EAAE;IACC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,CAAC,EAAE,SAAS,CAAC;CAChB,2CAyBA;AAED,wBAAgB,YAAY,CAAC,EACzB,OAAO,EACP,OAAO,EACP,MAAM,EACN,KAAK,EACL,CAAC,GACJ,EAAE;IACC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,CAAC,EAAE,SAAS,CAAC;CAChB,2CAkBA"}
@@ -0,0 +1,19 @@
1
+ import { KwikIdRNSDK } from "../../lib/kwik-id-rn-sdk";
2
+ import type { DocumentType, KwikIdConfig, KwikIdTheme, LivenessMode, SessionInfo } from "../../types";
3
+ export interface KwikIDContextValue {
4
+ sdk: KwikIdRNSDK;
5
+ sessionInfo: SessionInfo | null;
6
+ orgName?: string;
7
+ allowedDocumentTypes: DocumentType[];
8
+ livenessMode: LivenessMode;
9
+ theme: KwikIdTheme;
10
+ }
11
+ export interface KwikIDProviderProps {
12
+ config: KwikIdConfig;
13
+ /** Initialize the session immediately on mount (default true). */
14
+ autoInitialize?: boolean;
15
+ children: React.ReactNode;
16
+ }
17
+ export declare function KwikIDProvider({ config, autoInitialize, children }: KwikIDProviderProps): import("react").FunctionComponentElement<import("react").ProviderProps<KwikIDContextValue | null>>;
18
+ export declare function useKwikID(): KwikIDContextValue;
19
+ //# sourceMappingURL=kwik-id-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kwik-id-provider.d.ts","sourceRoot":"","sources":["../../../../../src/ui/context/kwik-id-provider.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EACR,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,WAAW,EACd,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,kBAAkB;IAC/B,GAAG,EAAE,WAAW,CAAC;IACjB,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oBAAoB,EAAE,YAAY,EAAE,CAAC;IACrC,YAAY,EAAE,YAAY,CAAC;IAC3B,KAAK,EAAE,WAAW,CAAC;CACtB;AAID,MAAM,WAAW,mBAAmB;IAChC,MAAM,EAAE,YAAY,CAAC;IACrB,kEAAkE;IAClE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,cAAqB,EAAE,QAAQ,EAAE,EAAE,mBAAmB,sGA6B9F;AAED,wBAAgB,SAAS,IAAI,kBAAkB,CAM9C"}
@@ -0,0 +1,29 @@
1
+ import type { DocumentType, KwikIdTheme, LivenessMode, Locale, VerificationOutcome } from "../../types";
2
+ export interface UseKwikVerificationOptions {
3
+ clientSecret: string;
4
+ baseUrl?: string;
5
+ appName?: string;
6
+ theme?: KwikIdTheme;
7
+ locale?: Locale;
8
+ /**
9
+ * @deprecated Not yet supported: accepted for forward compatibility but ignored.
10
+ * Phase 1 is capture-only; on-device liveness (and this option) lands in Phase 2.
11
+ */
12
+ livenessMode?: LivenessMode;
13
+ documentTypes?: DocumentType[];
14
+ skipRuntimeCheck?: boolean;
15
+ onSubmitted?: (data: {
16
+ jobId: string;
17
+ }) => void;
18
+ }
19
+ export interface UseKwikVerification {
20
+ /** Open the flow; resolves when the user reaches a terminal state. */
21
+ start: () => Promise<VerificationOutcome>;
22
+ /** Programmatically dismiss (resolves a pending start() as cancelled). */
23
+ cancel: () => void;
24
+ isOpen: boolean;
25
+ /** Render this once in your tree; the verification UI mounts here. */
26
+ Modal: React.FC;
27
+ }
28
+ export declare function useKwikVerification(options: UseKwikVerificationOptions): UseKwikVerification;
29
+ //# sourceMappingURL=use-kwik-verification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-kwik-verification.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/use-kwik-verification.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACR,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,MAAM,EACN,mBAAmB,EACtB,MAAM,aAAa,CAAC;AAGrB,MAAM,WAAW,0BAA0B;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CACnD;AAED,MAAM,WAAW,mBAAmB;IAChC,sEAAsE;IACtE,KAAK,EAAE,MAAM,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1C,0EAA0E;IAC1E,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,sEAAsE;IACtE,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC;CACnB;AAQD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,mBAAmB,CAyE5F"}
@@ -0,0 +1,7 @@
1
+ export { KwikIDVerificationModal } from "./components/KwikIDVerificationModal";
2
+ export type { KwikIDVerificationModalProps } from "./components/KwikIDVerificationModal";
3
+ export { useKwikVerification } from "./hooks/use-kwik-verification";
4
+ export type { UseKwikVerification, UseKwikVerificationOptions, } from "./hooks/use-kwik-verification";
5
+ export { KwikIDProvider, useKwikID } from "./context/kwik-id-provider";
6
+ export type { KwikIDProviderProps, KwikIDContextValue } from "./context/kwik-id-provider";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,YAAY,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,YAAY,EACR,mBAAmB,EACnB,0BAA0B,GAC7B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvE,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC"}