> ## Documentation Index
> Fetch the complete documentation index at: https://docs.towns.com/llms.txt
> Use this file to discover all available pages before exploring further.

# connectTowns

Connect to Towns using a SignerContext

Useful for server side code, allowing you to persist the signer context and use it to auth with Towns later

## Imports

```ts theme={null}
import { connectTowns } from '@towns-protocol/react-sdk'
```

## Definition

```ts theme={null}
function connectTowns(
  signerContext: SignerContext,
  config: Omit<SyncAgentConfig, "context">,
): Promise<SyncAgent>
```

**Source:** [connectTowns](https://github.com/towns-protocol/towns/blob/main/packages/react-sdk/src/connectTowns.ts)

## Parameters

### signerContext

* **Type:** `SignerContext`

The signer context to use

### config

* **Type:** `Omit<SyncAgentConfig, "context">`

The configuration for the sync agent

## Return Type

The sync agent

```ts theme={null}
Promise<SyncAgent>
```
