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

# useThreads

Hook to get the threads from a stream.

## Imports

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

## Definition

```ts theme={null}
function useThreads(
  streamId: string,
  config?: ObservableConfig.FromObservable<TimelinesMap>,
): ObservableValue<TimelinesMap>
```

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

## Parameters

### streamId

* **Type:** `string`

The id of the stream to get the threads from.

### config

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

Configuration options for the observable.

## Return Type

The threads of the stream as a map from the message eventId to a thread.

```ts theme={null}
ObservableValue<TimelinesMap>
```
