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

# useUserGdms

Hook to get the group dm streams of the current user.

## Imports

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

## Examples

You can combine this hook with the `useGdm` hook to get all group dm streams of the current user and render them:

```tsx theme={null}
import { useUserGdms, useGdm } from '@towns-protocol/react-sdk'

const AllGdms = () => {
    const { streamIds } = useUserGdms()
    return <>{streamIds.map((streamId) => <Gdm key={streamId} streamId={streamId} />)}</>
}

const Gdm = ({ streamId }: { streamId: string }) => {
    const { data: gdm } = useGdm(streamId)
    return <div>{gdm.metadata?.name || 'Unnamed Gdm'}</div>
}
```

## Definition

```ts theme={null}
function useUserGdms(
  config?: ObservableConfig.FromObservable<Gdms>,
): {
    error: Error | undefined;
    status: "loading" | "loaded" | "error";
    isLoading: boolean;
    isError: boolean;
    isLoaded: boolean;
    streamIds: string[];
}
```

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

## Parameters

### config

* **Type:** `ObservableConfig.FromObservable<Gdms>`
* **Optional**

Configuration options for the observable.

## Return Type

The list of all group dm stream ids of the current user.

```ts theme={null}
{
    error: Error | undefined;
    status: "loading" | "loaded" | "error";
    isLoading: boolean;
    isError: boolean;
    isLoaded: boolean;
    streamIds: string[];
}
```
