# getConnection | @account-kit/core

> Overview of the getConnection 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 getConnection(config): Connection;
```

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

Used to get the connection for the currently active chain

## Example

```ts
import { getConnection } from "@account-kit/core";
import { config } from "./config";

const connection = getConnection(config);
```

## 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`](../type-aliases/AlchemyAccountsConfig)
      </td>

      <td>
        the account config
      </td>
    </tr>

  </tbody>
</table>

## Returns

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

a connection object for the current active chain