Security Scanning
Recommended: Perform a Normalized Scan Snapshot
Section titled “Recommended: Perform a Normalized Scan Snapshot”performScan() is the easiest way to consume the SDK from React Native because it normalizes the cross-platform data into one object:
import { AlphynSDK } from '@alphyn/react-native-sdk';
const result = await AlphynSDK.performScan();
console.log('Is Safe:', result.isSafe);console.log('Primary Risk Factor:', result.primaryRiskFactor);console.log('All Risk Factors:', result.allRiskFactors);console.log('Reject Reasons:', result.rejectReasons);console.log('Scan Date:', result.scanDate);
if (!result.isSafe) { console.warn('Security threats detected');}Get Raw Scan Summary
Section titled “Get Raw Scan Summary”getScanResult() returns the native SDK’s raw formatted scan summary string:
const scanSummary = await AlphynSDK.getScanResult();console.log('Scan Summary:', scanSummary);Get Security Rejection Reasons
Section titled “Get Security Rejection Reasons”The React Native layer normalizes rejection reasons into a string[] on both platforms:
const rejectReasons = await AlphynSDK.getRejectReasons();
rejectReasons.forEach((reason) => { console.log('Reject reason:', reason);});Get Last Scan Date
Section titled “Get Last Scan Date”const lastScanDate = await AlphynSDK.getLastScanDate();
if (lastScanDate) { console.log('Last scan date:', lastScanDate.toISOString());} else { console.log('No scan has been recorded yet');}Verify High-Risk Actions
Section titled “Verify High-Risk Actions”signAction signs with a hardware-backed key that belongs to one enrolled user, so
enrollForMfa(userId) must have run once on this device first, and userId below is your own
identifier for the logged-in user. The PIN is optional. See
MFA Transaction Signing for the full flow.
Use action verification for sensitive operations such as transfers, withdrawals, profile changes, or privileged actions:
const verification = await AlphynSDK.signAction(userId, 'WITHDRAW', { amount: 1000, currency: 'USD', destination: 'IBAN123456789',});
if (verification.success) { await api.processWithdrawal({ amount: 1000, currency: 'USD', verificationToken: verification.verificationToken, });} else { console.error('Verification failed:', verification.errorCode, verification.errorMessage);}