# watchUser | @account-kit/core

> Overview of the watchUser 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 watchUser(config): (onChange) => any;
```

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

Watches for changes to the user in the client store and triggers the provided callback when a change is detected.

## Example

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

watchUser(config)(console.log);
```

## Parameters

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

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

      <td>
        `AlchemyAccountsConfig`
      </td>

      <td>
        the configuration containing the client store
      </td>
    </tr>

  </tbody>
</table>

## Returns

a function which accepts a callback that fires when the user changes and returns a function to unsubscribe from the user updates

```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>
        (`user?`) => `void`
      </td>
    </tr>

  </tbody>
</table>

### Returns

`any`