Skip to main content

React JS

Integrating ezto verify's Web SDK into your React.js project is a streamlined process. Follow these steps to add the necessary files and initiate the verification process within your React application.

Implement the SDK in Component

Set up your React.js component to utilize the ezto verify SDK:

jsx
import { useEffect } from 'react';

const YourComponent = () => {

useEffect(() => {
// code to be executed when component mount
}, []);

const eztoverify = new window.eztoverify();

const webSDKRequest = () => {
const metadata = {
request: /* request body of transaction */
};
const cnfg = {
api: "{{base_url}}/auth/realms/api/ezto_web_push/{{appId}}/{{workspaceName}}/register"
};
eztoverify.request(metadata, cnfg, callback);
}

const callback = (response) => {
console.log('Response:', response);
};

return (
<div>
{/* JSX content here */}
<button onClick={webSDKRequest}>Start verification</button>
</div>
);
};

export default YourComponent;