4. QuadClient Package
<QuadClient /> Component
<QuadClient /> Component
import { QuadClient } from '@quadrata/client-react';
const MyComponent = () => {
<QuadClient
accessToken={accessToken} // JWT token obtained by calling /v1/api/login
account={account} // wallet address of the user to onboard
attributes={quadAttributes} // list of attributes required by the protocol
bypassMint={bypassMint} // Optional boolean flag indicating whether to bypass the mint screen. If this is set to true, onMintClick is optional
chainId={chainId} // Blockchain chainId to onboard to (see: https://chainlist.org/)
config={quadConfig} // Custom Configuration (i.e endpoint, protocol name)
darkMode={false}
mintComplete={mintComplete} // Boolean flag indicating when the "passport minting" is completed
mintError={mintError} // Optional string that can be passed to display mint error message
offeringId={offeringId} // Optional string or number that can be passed to track accreditation status for a company offering
onApplicationEnd={handleOnApplicationEnd} // Optional callback function: triggered when the application reaches an end state (error or completion)
onConsentGranted={handleConsentGranted} // Optional callback function: triggered with privacy consent is granted
onHide={handleHide} // Optional callback function: triggered when the modal is closed
onMintClick={handleMintClick} // Optional callback function: triggered when a user clicks "Claim Passport"
onMintParamsReady={handleMintParamsReady} // Optional callback function: triggered when the mint parameters are signed and ready to mint
onPageChange={handlePageChange} // Optional callback function: triggers when a page changes
onSign={handleSign} // Callback function: triggered when a user attemps to Sign Wallet or Allow Consent
privacyScopes={privacyScopes} // Optional list of privacy scopes to request for consent
signature={signature} // store the result of the callback `onSign`
signatureConsent={signatureConsent} // store the result of the callback `onSign` when consent is requested
transactionHash={data?.hash} // The mint blockchain transaction hash
>
Loading...
</QuadClient>
}
<QuadClient />
Props
<QuadClient />
PropsConfiguration Object
Pass a configuration object to the config
prop:
import { QuadClient, QuadClientConfig, QuadClientEnvironment } from '@quadrata/client-react';
// Outside of your react component
const quadConfig: QuadClientConfig = {
protocolName: 'ACME, Inc.',
environment: QuadClientEnvironment.PRODUCTION, // or QuadClientEnvironment.SANDBOX for testing environment
};
// Inside your react component
<QuadClient config={quadConfig} />
Always define your configuration object outside of your React components to prevent unexpected behavior
NOTE: Contact Quadrata via email to request API keys.
Get User's Permissions
Last updated