React components for QR code authentication and verification with QRAuth.
npm install @qrauth/reactimport { QRAuthBadge } from '@qrauth/react';
export function MyApp() {
return (
<QRAuthBadge
token="qr-token-string"
theme="light"
onVerified={(result) => {
console.log('Verification result:', result);
}}
onFraudDetected={(result) => {
console.log('Fraud detected:', result);
}}
/>
);
}<QRAuthBadge
token="qr-token-string"
showLocation={true}
showIssuer={true}
onVerified={(result) => {
if (result.locationMatch) {
console.log('Location verified!');
}
}}
/>token(string, required): The QR code token to verifytheme('light' | 'dark', optional): Badge theme (default: 'light')showLocation(boolean, optional): Show location information (default: false)showIssuer(boolean, optional): Show issuer information (default: true)onVerified(function, optional): Callback when verification succeedsonFraudDetected(function, optional): Callback when fraud is detectedapiKey(string, optional): API key for authenticationapiBaseUrl(string, optional): Custom API base URL
{
verified: boolean;
issuer: {
name: string;
trustLevel: 'low' | 'medium' | 'high';
};
destination: string;
locationMatch: boolean;
trustScore: number;
}The component uses inline styles for styling with no external CSS dependencies. You can customize the appearance through props and the component will adapt to your application's styling.
For more information, visit docs.qrauth.io