# useSmartAccountClient | @account-kit/react

> [Hook](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/react/src/hooks/useSmartAccountClient.ts) that uses the provided smart account client parameters to create or retrieve an existing smart account client, handling different types of accounts including LightAccount, MultiOwnerLightAccount, and MultiOwnerModularAccount. Under the hood, Smart Account Client takes care of all the necessary middleware operations needed to populate a user operation such as gas estimation and paymaster data.  If passing in an undefined client, Smart Account Client will treat the connected account as an EOA.  If using with an EOA, Smart Account Client won’t throw an error, but the client itself will stay undefined forever. We recommend useBundlerClient instead when using an EOA. The EOA must also be connected or authenticated with a signer.

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

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

```ts
function useSmartAccountClient<TChain, TAccount>(
  args,
): UseSmartAccountClientResult<
  TChain,
  SupportedAccount<TAccount extends undefined ? "ModularAccountV2" : TAccount>
>;
```

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

## Type Parameters

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

  <tbody>
    <tr>
      <td>
        `TChain` *extends* `undefined` | [`Chain`](https://viem.sh)
      </td>

      <td>
        `undefined` | [`Chain`](https://viem.sh)
      </td>
    </tr>

    <tr>
      <td>
        `TAccount` *extends* `undefined` | `SupportedAccountTypes`
      </td>

      <td>
        `"ModularAccountV2"`
      </td>
    </tr>

  </tbody>
</table>

## Parameters

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

  <tbody>
    <tr>
      <td>
        `args`
      </td>

      <td>
        [`UseSmartAccountClientProps`](../type-aliases/UseSmartAccountClientProps)\<`TChain`, `TAccount`>
      </td>
    </tr>

  </tbody>
</table>

## Returns

[`UseSmartAccountClientResult`](../type-aliases/UseSmartAccountClientResult)\<`TChain`, `SupportedAccount`\<`TAccount` _extends_ `undefined` ? `"ModularAccountV2"` : `TAccount`>>

An object containing the smart account client, the address, and a loading state. [ref](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/react/src/hooks/useSmartAccountClient.ts#L24)