# watchSmartAccountClient | @account-kit/core

> Overview of the watchSmartAccountClient function from @account-kit/core

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

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

```ts
function watchSmartAccountClient<TAccount, TChain>(
  params,
  config,
): (onChange) => any;
```

Defined in: [account-kit/core/src/actions/watchSmartAccountClient.ts:33](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/core/src/actions/watchSmartAccountClient.ts#L33)

Watches for changes to the smart account client and triggers the provided callback when a change is detected.

## Example

```ts
import { watchSmartAccountClient } from "@account-kit/core";
// see createConfig for more information on how to create a config
import { config } from "./config";

watchSmartAccountClient({ type: "LightAccount" }, config)(console.log);
```

## Type Parameters

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

  <tbody>
    <tr>
      <td>
        `TAccount` *extends* `SupportedAccountTypes`
      </td>

      <td>
        ‐
      </td>

      <td>
        extends SupportedAccountTypes
      </td>
    </tr>

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

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

      <td>
        extends Chain | undefined = Chain | undefined
      </td>
    </tr>

  </tbody>
</table>

## Parameters

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

  <tbody>
    <tr>
      <td>
        `params`
      </td>

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

      <td>
        the parameters needed to get the smart account client
      </td>
    </tr>

    <tr>
      <td>
        `config`
      </td>

      <td>
        `AlchemyAccountsConfig`
      </td>

      <td>
        the configuration containing the client store and other settings
      </td>
    </tr>

  </tbody>
</table>

## Returns

a function that accepts a callback to be called when the client changes and returns a function to unsubscribe from the store

```ts
(onChange): any;
```

### Parameters

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

  <tbody>
    <tr>
      <td>
        `onChange`
      </td>

      <td>
        (`client`) => `void`
      </td>
    </tr>

  </tbody>
</table>

### Returns

`any`