# useSendVerificationCode | @account-kit/react

> Overview of the useSendVerificationCode hook from @account-kit/react

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

{/* This file is auto-generated by TypeDoc. Do not edit manually. */}

```ts
function useSendVerificationCode(mutationArgs?): UseSendVerificationCodeResult;
```

Defined in: [account-kit/react/src/hooks/useSendVerificationCode.ts:74](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/react/src/hooks/useSendVerificationCode.ts#L74)

A custom hook to send OTP verification codes to email or SMS for account verification.

## Example

```ts twoslash
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: "user@example.com",
});

// Send verification code to SMS
sendVerificationCodeAsync({
  type: "sms",
  contact: "+1234567890",
});
```

## Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `mutationArgs?`
      </td>

      <td>
        `Partial`\<`Omit`\<`UseMutationOptions`\<`void`, `Error`, [`SendVerificationCodeParams`](../interfaces/SendVerificationCodeParams), `unknown`>, `"mutationFn"` | `"mutationKey"`>>
      </td>

      <td>
        Optional arguments for the mutation
      </td>
    </tr>

  </tbody>
</table>

## Returns

[`UseSendVerificationCodeResult`](../type-aliases/UseSendVerificationCodeResult)

An object containing functions and state for sending verification codes