CreateWallet (React SDK)

Integration

Provide the user’s email address and success callback handler to the component. When this component is rendered, an email is sent to the user prompting them to verify it. Once verified, a NFTgate Wallet address on the chain specified in NFTgateSDKProvider is returned.

The same email address will always resolve to the same wallet address on a given blockchain so it is safe to verify email addresses that already have a NFTgate Wallet.

Code example

<NFTgateSDKProvider chainName="Polygon"> 
    <CreateWallet 
        emailAddress="[email protected]" 
        onSuccess={(user) => { ... }} 
        onError={(error) => { ... }} 
    /> 
</NFTgateSDKProvider>

Props

Prop Type Description
emailAddress * string The user’s email address that needs to be verified.
onSuccess * (user: {
emailAddress: string;
walletAddress: string;
}) => void
A callback called when the email is verified and wallet address is created.

The user’s email address and wallet address are returned.

redirectUrl string A URL to redirect the user once they click the link in their email.

If not provided, the email link prompts the user to close the tab and return to your app.

clientId string If provided, an accessCode is provided in the onSuccess callback. This accessCode is used to query the user’s wallet information later.
onEmailVerificationInitiated () => void A callback called after NFTgate sends an email for the user to verify.

If not provided, NFTgate provides a UI to tell the user to check their inbox.

onError (error: NFTgateSDKError) => void A callback called if there is an error sending the email or creating a wallet
address.

 

Customization

Button
If no child element is passed in, a default button is rendered.

CreateWallet default button

Provide your own button by passing a child element into the React component.

<CreateWallet> 
    <button class='my-button'>Sign In</button>
</CreateWallet>

Email verification prompt

By default, NFTgate shows a modal prompting the user to check their email.
To provide your own UX, provide the onEmailVerificationInitiated callback to provide your own instructions prompting the user to check their inbox.