@wyasolutions/react-native-wya-verify-sdk
v2.2.0
Published
WYA Verify delivers KYC and Proof of Person through digital onboarding and facial biometrics.
Maintainers
Readme
React Native WYA Verify SDK
WYA Verify delivers KYC and Proof of Person through digital onboarding and facial biometrics.
Installation
npm install @wyasolutions/react-native-wya-verify-sdkUsage
Integration Flows
Onboarding
sequenceDiagram
autonumber
actor App as Integrator App
participant RN as React Native SDK
participant Native as Native Bridge (iOS/Android)
participant WYA as WYA Verify SDK
participant Backend as Integrator Backend
App->>RN: startOnboarding({publicKey, idType})
RN->>Native: startOnboarding({publicKey, idType})
Native->>WYA: launch onboarding
WYA-->>Native: result (raw)
Native-->>RN: resolve(result)
RN-->>App: WyaOnboardingResult {verified, raw}Face Match
sequenceDiagram
autonumber
actor App as Integrator App
participant RN as React Native SDK
participant Native as Native Bridge (iOS/Android)
participant WYA as WYA Verify SDK
participant Backend as Integrator Backend
App->>Backend: /init (request operationId)
Backend-->>App: operationId
App->>RN: startFaceMatch({publicKey, operationId})
RN->>Native: startFaceRecognition({publicKey, faceOperation: MATCH})
Native->>WYA: launch face match
WYA-->>Native: result {operationId, status, decision}
Native-->>RN: resolve(result)
RN-->>App: WyaFaceMatchResult {verified, raw}Face Enroll
sequenceDiagram
autonumber
actor App as Integrator App
participant RN as React Native SDK
participant Native as Native Bridge (iOS/Android)
participant WYA as WYA Verify SDK
participant Backend as Integrator Backend
App->>Backend: /init (request operationId)
Backend-->>App: operationId
App->>RN: startFaceEnroll({publicKey, operationId})
RN->>Native: startFaceEnroll({publicKey, faceOperation: ENROLL})
Native->>WYA: launch face enroll
WYA-->>Native: result {operationId, status, decision}
Native-->>RN: resolve(result)
RN-->>App: WyaFaceEnrollResult {enrolled, raw}Onboarding
import { startOnboarding } from '@wyasolutions/react-native-wya-verify-sdk';
const result = await startOnboarding({
publicKey: '<public-key>',
idType: 'ARG_AUTO', // auto-detects the document type
operationId: '<operation-id>',
nonce: '<nonce>',
accentColor: '#7C5CFF', // optional: theme the SDK UI
language: 'es', // optional: force the UI language
});
// JWT is available inside result.raw.Face Match (Verify)
import { startFaceMatch } from '@wyasolutions/react-native-wya-verify-sdk';
const result = await startFaceMatch({
publicKey: '<public-key>',
operationId: '<operation-id>',
nonce: '<nonce>',
});
// result.verified indicates whether the face matched.
// result.raw includes operationId, status, and decision from the native SDK.Face Enroll (Registration)
import { startFaceEnroll } from '@wyasolutions/react-native-wya-verify-sdk';
const result = await startFaceEnroll({
publicKey: '<public-key>',
operationId: '<operation-id>',
nonce: '<nonce>',
});
// result.enrolled indicates whether the enrollment completed.API
startOnboarding(params): Promise<WyaOnboardingResult>
startFaceMatch(params): Promise<WyaFaceMatchResult>
startFaceEnroll(params): Promise<WyaFaceEnrollResult>
isAvailable(): Promise<boolean>
getVersion(): Promise<{ android?: string; ios?: string }>
getDeviceId(): Promise<string>getDeviceId() returns the persistent device id the SDK sends with every
operation, so the host app can correlate its own backend calls with the SDK's.
Document type (idType)
idType tells the onboarding flow which Argentine ID document to expect:
ARG_AUTO— the SDK auto-detects the document type from the captured image. This is the recommended value; use it unless you have a reason to pin a specific version.ARG_1·ARG_2·ARG_3·ARG_4— pin a specific Argentine ID document version.
Parameters
OnboardingParamspublicKey: stringidType: string — see Document typeoperationId?: stringnonce?: stringaccentColor?: string — hex color (e.g.#7C5CFF) to theme the SDK UIlanguage?: string — language code (e.g.es,en) to force the UI language
FaceMatchParamspublicKey: stringoperationId: stringnonce: stringaccentColor?: stringlanguage?: stringshowSelfieIntroOnce?: boolean — show the instructional intro only the first time the match flow runs on this install; later step-up authorizations go straight to capture. Match only (enroll always shows its quality intro). Defaults tofalse.
FaceEnrollParamspublicKey: stringoperationId: stringnonce: stringaccentColor?: stringlanguage?: string
Return Values
WyaOnboardingResultverified: booleanraw?: json object
WyaFaceMatchResultverified: booleanraw?: json object
WyaFaceEnrollResultenrolled: booleanraw?: json object
Errors
Errors are thrown as WyaError with:
code:E_INVALID_PARAMSE_CANCELLEDE_NATIVE_FAILUREE_ACTIVITY_MISSINGE_UNSUPPORTED_PLATFORM
messagedetails?
React Native Compatibility
- Supported React Native versions: 0.71.x to 0.83.x.
Security
- Do not commit public keys, JWTs, or other secrets to source control.
- Avoid logging biometric data or JWT payloads.
- Store credentials securely and pass them at runtime.
