<h1 align="center">Verifire Client Library</h1>
npm install verifire-client-library``bash`
npm i verifire-client-library
`jsx
import { VerfireLogin, VerifireClientContext } from 'verifire-client-library'
function App() {
let verifireOptions = {
verifireClient: 'https://localhost.something.com:12000',
callback: (response) => handleCredentialResponse(response),
}
const [credential, setCredential] = useState(null)
const handleCredentialResponse = (credentials) => {
if (!credentials) {
// route to signin/signup page
}
setCredential(credentials)
}
const onLogout = () => {
window.location.reload()
}
return (
{JSON.stringify(credential.profile)}Render profile dropdown
`jsx
{credential && window.verifireClient.renderProfileDropdown({ logoutCallback: onLogout })}
``Wrap your authenticated module root around VerifireClientContext to make sure your routes are protected.