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

# useScrollback

Hook to get the scrollback action for a stream.

Scrollback is the action of getting miniblocks from a stream before a certain point in time. Getting miniblocks means that new events that are possibly new messages, reactions and so on are fetched.

## Imports

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

## Definition

```ts theme={null}
function useScrollback(
  streamId: string,
  config?: ActionConfig<MessageTimeline["scrollback"]>,
): {
    data: {
        terminus: boolean;
        fromInclusiveMiniblockNum: bigint;
    } | undefined;
    error: Error | undefined;
    isPending: boolean;
    isSuccess: boolean;
    isError: boolean;
    scrollback: () => Promise<{
        terminus: boolean;
        fromInclusiveMiniblockNum: bigint;
    }>;
}
```

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

## Parameters

### streamId

* **Type:** `string`

The id of the stream to get the scrollback action for.

### config

* **Type:** `ActionConfig<MessageTimeline["scrollback"]>`
* **Optional**

Configuration options for the action.

## Return Type

The `scrollback` action and its loading state.

```ts theme={null}
{
    data: {
        terminus: boolean;
        fromInclusiveMiniblockNum: bigint;
    } | undefined;
    error: Error | undefined;
    isPending: boolean;
    isSuccess: boolean;
    isError: boolean;
    scrollback: () => Promise<{
        terminus: boolean;
        fromInclusiveMiniblockNum: bigint;
    }>;
}
```
