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

# useCreateGdm

A hook that allows you to create a new group direct message (GDM).

## Imports

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

## Definition

```ts theme={null}
function useCreateGdm(
  config?: ActionConfig<Gdms["createGDM"]>,
): {
    data: {
        streamId: string;
    } | undefined;
    error: Error | undefined;
    isPending: boolean;
    isSuccess: boolean;
    isError: boolean;
    createGDM: (userIds: string[], channelProperties?: EncryptedData | undefined, streamSettings?: {
        disableMiniblockCreation: boolean;
        lightStream: boolean;
    } | undefined) => Promise<{
        streamId: string;
    }>;
}
```

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

## Parameters

### config

* **Type:** `ActionConfig<Gdms["createGDM"]>`
* **Optional**

The action config.

## Return Type

An object containing the `createGDM` action and the rest of the action result.

```ts theme={null}
{
    data: {
        streamId: string;
    } | undefined;
    error: Error | undefined;
    isPending: boolean;
    isSuccess: boolean;
    isError: boolean;
    createGDM: (userIds: string[], channelProperties?: EncryptedData | undefined, streamSettings?: {
        disableMiniblockCreation: boolean;
        lightStream: boolean;
    } | undefined) => Promise<{
        streamId: string;
    }>;
}
```
