Skip to main content

CodeVerify

Component for verifying codes when registering and logging in using phone number and email.

Usage

<CodeVerify
chainId="AELF"
accountType="Email"
verifier={{
endPoints: ["your endPoints"],
verifierAddresses: ["your verifierAddresses"],
id: "your verifier id",
name: "your verifier name",
imageUrl: "your verifier imageUrl",
}}
verifierSessionId={"080bbdcd-73f5-45a6-b65b-0d067474756f"}
guardianIdentifier={"xxx@xxx.com"}
operationType={OperationTypeEnum.addGuardian}
onError={(error: any) => {
console.log("onError", error);
}}
onSuccess={(result) => {
console.log("onConfirm", result);
}}
/>

API

PropertyDescriptionTypeDefaultVersion
originChainIdID of the chain where user account is registeredChainIdAELFV1.5.1
targetChainIdID of the chain which the current operation targetsChainId-V1.5.1
verifierVerifier serviceVerifierItem-
operationDetailsSign and verify additional informationTStringJSON-
classNameCustomized class namestring-
accountTypeIdentifier typeAccountTypeEmail
isCountdownNowDoes the countdown start as soon as the page is renderedboolean-
isLoginGuardianIs it login identifierboolean-
guardianIdentifierIdentifier information (email, phone, Google ID, Apple ID)string-
verifierSessionIdverifierSessionId after verification code is sentstring-
isErrorTipIs error tip set as defaultbooleantrue
operationTypeOperation typeOperationTypeEnum-
onErrorCallback of error(error: {errorFields: string, error: any }) => void;-
onSuccessCallback of finishing(result: {verificationDoc: string; signature: string; verifierId: string; }) => void;-
onReSendCallback when the resend button is clicked(result: {verifier: VerifierItem; verifierSessionId:string; }) => void-