Identity (Ethers v5 / React)
Follow below steps to integrate the Identity flow into your dapp!
Last updated
Was this helpful?
Follow below steps to integrate the Identity flow into your dapp!
Last updated
Was this helpful?
First, create the SDK: The first argument should be an ethers Web3Provider, since the user will need to sign his Identifier. Second argument is which environment and chain contract set to use.
Then, trigger the signing request and get the link to redirect the user to the FaceVerification process and either open the link in a popup or redirect the user.
firstName - Display only. Used to greet user on the face verification screen.
callbackUrl (optional defaults to current window location) - In case of popupMode is true, then a POST call will be made to the callbackUrl. Otherwise, the user will be redirected to the callbackUrl.
popupMode (optional defaults to false)
If false, it is assumed user was redirected to the FaceVerification process and he will be redirected back to the callbackUrl with result params encoded in query string.
False should be used for mobile together with a deeplink callback.
If true it is assumed a popup window/tab was opened with the FaceVerification link. Once user finishes FV it will try to close the popup and make a POST call to the callback url with JSON encoded params in body.
chainId (optional) - Addresses will always be registered on all active chains. This simply marks on which chain the user was originally from. It can be used for invite campaigns and to prevent claiming invite rewards on multiple chains.
The callbackUrl will be called with two params containing the result of the FV process.
isVerified - true if user passed FV, false otherwise
reason - If isVerified is false this can contain an error message.
Since no connection is kept between the identity record and a user's wallet in our database, to delete an identity the user has to send to our server his unique identifier (generated by signing a message). The backend will then unregister the wallet from the Identity contracts on all active chains. info
You can also use our react hooks to manage identity.
Use the isAddressVerified method to query the status of a wallet directly from the smart contract.
See the Claim/Identity react hooks code . Storybook examples . You will need to first setup our context provider as explained .
Please ensure you have for this SDK.
Share your ideas, or ask for development support. Be sure to check out the For discussion on Discord or various program events: We are also on Telegram: