Skip to content

Security Scanning

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');
}

getScanResult() returns the native SDK’s raw formatted scan summary string:

const scanSummary = await AlphynSDK.getScanResult();
console.log('Scan Summary:', scanSummary);

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);
});
const lastScanDate = await AlphynSDK.getLastScanDate();
if (lastScanDate) {
console.log('Last scan date:', lastScanDate.toISOString());
} else {
console.log('No scan has been recorded yet');
}

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);
}