# with npm
npm install @verifai/websdk-react --save
# or with yarn
yarn add @verifai/websdk-react
import React, { useState } from "react"
import WebSDK from '@verifai/websdk-react'
export default function MyComponent() {
const [show, setShow] = useState(true)
return <WebSDK
// For the token look at: https://docs.verifai.com/sdk/web/
token="<OTP_TOKEN>"
show={show} // you can manipulate the show prop to show and hide the modal.
onSuccess={sessionID => {
// set show prop to false, to close the modal
setShow(false)
// Here you can get the Verifai result.
// And also clear the Verifai session.
}}
onCanceled={sessionID => {
// set show prop to false, to close the modal
setShow(false)
// Here your customer canceled the Verifai flow
// And you can clear the Verifai session
}}
/>
}
For more configuration and options you can see the documentation.
Want to try it out first? There is a demo available at: demo.websdk.verifai.com.
Please visit our website for more information about this and our other products: verifai.com.