Sismo Connect Client: Request
Request proofs from your user
The Sismo Connect Client is a front-end package built on top of the Data Vault app (the prover) to easily request proofs from your users with AuthRequests, ClaimRequests and SignatureRequests.
Installation
Install the Sismo Connect Client package in your front end with npm
or yarn
:
Make sure to have at least v18.15.0 as Node version. You can encounter issues with ethers dependencies if not.
Example Usage
Here is an example of a customized usage of the request function:
You want to create an NFT airdrop for holders of a Nouns DAO NFT owning a Gitcoin Passport and a Twitter account.
So you want your users to prove that they own a Nouns DAO NFT. In order to make your airdrop more Sybil-resistant, you will require them to also prove a Gitcoin Passport ownership with a passport value greater or equal to 15 and a Twitter account ownership.
These proofs should be made for the service named "sismo-edition". When the proofs are generated, you want your users to be redirected to the claim page of your website at the path "https://my-nft-drop.xyz/sismo-edition/claim-nft".
You will then use these proofs to airdrop an NFT if they are valid.
A namespace is useful when you want your users to generate proofs for different services in an app. You can see more information about how to use it in the Sismo Connect Server package documentation.
getResponse()
getResponse()
The getResponse
function returns the SismoConnectResponse
object containing the proofs generated by your user after coming back from the Data Vault app. Proofs can be sent to your back end and verified thanks to the @sismo-core/sismo-connect-server
package OR sent to your contract that uses the Sismo Connect Solidity library to verify.
getResponseBytes()
getResponseBytes()
The getResponseBytes
function returns the response encoded in bytes usable by the @sismo-core/sismo-connect-solidity
Library.
SismoConnectResponse
SismoConnectResponse
Last updated