truvaxia-react-native-sdk
v1.0.8
Published
React Native SDK for Truvaxia Fraud & Biometric Service
Readme
Truvaxia React Native SDK
The official React Native SDK for Truvaxia - Zero-Trust Identity Verification and Fraud Prevention. It provides seamless behavioral telemetry, device fingerprinting, and biometric liveness checks to secure sensitive user actions.
Installation
npm install @truvaxia/react-native-sdk react-native-webviewInitialization
Initialize the SDK globally, ideally at the root of your app (App.tsx or index.js):
import { Truvaxia } from '@truvaxia/react-native-sdk';
Truvaxia.init({
apiKey: 'YOUR_TRUVAXIA_API_KEY', // Get this from your Truvaxia Dashboard
});Usage (Drop-in Widget)
To trigger the full Zero-Trust Onboarding Flow (Liveness + Device + Behavioral), simply render the TruvaxiaWidget component. It automatically orchestrates permissions and telemetry gathering:
import { TruvaxiaWidget } from '@truvaxia/react-native-sdk';
export default function OnboardingScreen() {
return (
<TruvaxiaWidget
companyName="Your App Name"
data={{ userId: 'user_123', action: 'ONBOARDING' }}
callbacks={{
onSuccess: (result) => console.log("Verification Passed!", result),
onFailure: (error) => console.error("Verification Failed!", error)
}}
onCancel={() => console.log("User closed the widget")}
/>
);
}Usage (Standalone Liveness Scanner)
If you prefer to build your own custom UI and only need the AI facial verification logic, you can mount the TruvaxiaLivenessScanner independently. It will manage camera permissions and return the base64 captured frame upon success:
import { TruvaxiaLivenessScanner } from '@truvaxia/react-native-sdk';
import { View, Text } from 'react-native';
import { useState } from 'react';
export default function CustomScannerScreen() {
const [stage, setStage] = useState('Initializing...');
return (
<View style={{ flex: 1, backgroundColor: 'black' }}>
<Text style={{ color: 'white', padding: 20 }}>Current Step: {stage}</Text>
<TruvaxiaLivenessScanner
onProgress={(currentStage) => setStage(currentStage)}
onComplete={(result) => {
if (result.success) {
console.log("Captured Base64 Image:", result.frameBase64);
// Submit to your own backend
}
}}
onError={(error) => console.error(error)}
/>
</View>
);
}