The following code snippets should be embeded into the portal to initiate verfiication & validation flow.
<script src="https://web-button.mati.io/button.js"/>
2. In app.js or index.js, include the following
var unifidClient = require('mati-sdk').Mati;
const unifidEvents = () => {
let button = document.getElementById("unifid-button");
button.click();
// setup callbacks
button.addEventListener('mati:loaded', ({ detail }) => {
console.log('loaded payload matiEvent', detail)
});
button.addEventListener('mati:userFinishedSdk', ({ detail }) => {
console.log('finished payload', detail)
});
button.addEventListener('mati:exitedSdk', ({ detail }) => {
console.log('exited payload', detail)
});
}
<div style={{ padding: "30px 40px", margin: "20px" }}>
<button type="submit" onClick={unifidEvents} style={{color:" #fff", backgroundColor: "#0047CC", padding: "8px 22px", fontSize: "1rem"}}>
Verify My KYC
</button>
<mati-button
style={{ display: "none" }}
id="unifid-button"
clientId="<clientId>"
flowId="<flowId>"
color="#0047CC" // It's recommended to add color to speed up button initialization.
metadata={JSON.stringify({
"partner_id": "<patner ID>",
"ref_id": "<customer ID>",
"user_email": "<email@email.com>"
})}
/>
</div>
The following (partner specific) data items must be included in the above configuration