function useSendVerificationCode(mutationArgs?): UseSendVerificationCodeResult;Defined in: account-kit/react/src/hooks/useSendVerificationCode.ts:74
A custom hook to send OTP verification codes to email or SMS for account verification.
import { useSendVerificationCode } from "@account-kit/react";
const { sendVerificationCode, isSendingCode, error } = useSendVerificationCode({
onSuccess: (data) => {
console.log("OTP sent");
},
onError: (error) => console.error(error),
});
// Send verification code to email
sendVerificationCode({
type: "email",
contact: "[email protected]",
});
// Send verification code to SMS
sendVerificationCodeAsync({
type: "sms",
contact: "+1234567890",
});| Parameter | Type | Description |
|---|---|---|
|
| Optional arguments for the mutation |
An object containing functions and state for sending verification codes