> ## 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.

# useCreateChannel

Hook to create a channel.

## Imports

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

## Definition

```ts theme={null}
function useCreateChannel(
  spaceId: string,
  config?: ActionConfig<Space["createChannel"]>,
): {
    data: string | undefined;
    error: Error | undefined;
    isPending: boolean;
    isSuccess: boolean;
    isError: boolean;
    createChannel: (channelName: string, signer: Signer, opts?: {
        topic?: string;
    } | undefined) => Promise<string>;
}
```

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

## Parameters

### spaceId

* **Type:** `string`

### config

* **Type:** `ActionConfig<Space["createChannel"]>`
* **Optional**

Configuration options for the action.

## Return Type

The `createChannel` action and its loading state.

```ts theme={null}
{
    data: string | undefined;
    error: Error | undefined;
    isPending: boolean;
    isSuccess: boolean;
    isError: boolean;
    createChannel: (channelName: string, signer: Signer, opts?: {
        topic?: string;
    } | undefined) => Promise<string>;
}
```
