# watchSolanaConnection | @account-kit/core

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

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

Subscribe to changes to the solana connection for the id

## Example

```ts twoslash
import { watchSolanaConnection } from "@account-kit/core";
// see createConfig for more information on how to create a config
const config = {} as any;

watchSolanaConnection(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 account config of the connection
      </td>
    </tr>

  </tbody>
</table>

## Returns

a function which accepts an onChange callback that will be fired when the connection 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>
        (`connection`) => `void`
      </td>
    </tr>

  </tbody>
</table>

### Returns

`any`