> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sublay.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch comment reactions

> Fetch a paginated list of users who reacted to a comment

## Overview

`useFetchCommentReactions` returns a function that fetches individual reaction records for a comment. Use this to show "who reacted" lists, optionally filtered by a specific reaction type.

> [!NOTE]
>
> Authentication is optional — the endpoint works without a token. When the
> caller is signed in, reactions from users with a block between them and the
> caller, in either direction, are excluded from both the results and the
> count. Block filtering requires the `moderation` bundle.

## Usage Example

```tsx theme={null}
import { useFetchCommentReactions } from "@sublay/react-js";
import { useState } from "react";

function CommentLikers({ commentId }: { commentId: string }) {
  const fetchReactions = useFetchCommentReactions();
  const [reactions, setReactions] = useState([]);

  const load = async () => {
    const res = await fetchReactions({ commentId, page: 1, reactionType: "like" });
    setReactions(res.data);
  };

  return <button onClick={load}>See who liked</button>;
}
```

## Parameters

**commentId** `string` *required*

The comment to fetch reactions for.

**page** `number` *required*

Page number (1-indexed).

**limit** `number`

Results per page. Default: `20`.

**reactionType** `ReactionType`

Filter to a specific reaction type.

**sortDir** `"asc" | "desc"`

Sort direction by creation date. Default: `"desc"`.

**spaceReputation** `object`

Opt-in. Adds a `spaceReputation` number to each returned user,
scoped to a single space. Requires the `reputation` bundle.
The `reputation` total is always present regardless;
`spaceReputation` is purely additive and only appears when you
pass this object. **This object is the primary form** — it
replaces the deprecated flat props below. See the
[Reputation data model](https://docs.sublay.io/v7/data-models/reputation.md) for the
full contract.

**spaceReputation**

Which bucket to read. One of: a space **`<uuid>`**
(that space's bucket), **`"none"`** (the
project-general, space-less bucket), or
**`"context"`** (the space derived from the
request context — resolved per-row on lists, or the single space on
member/team/conversation surfaces). The empty string and the legacy
`general` / `null` aliases are rejected (400).
Missing buckets read as `0`.
Only honored when `spaceId` is an explicit space `<uuid>`.
When `true`, `spaceReputation` is the
**subtree sum** — the named space plus all of its
descendant spaces (the root space's own bucket included). Ignored for
`"none"`; not allowed with `"context"`.

**spaceReputationId** `string` *deprecated*

**Deprecated** — use the `spaceReputation`
object instead. The flat form of `spaceReputation.spaceId`.
Still accepted (the object wins if both are passed); removal is a later
major version. Accepts a space `<uuid>`, `"none"`, or
`"context"`.

**spaceReputationDescendants** `boolean` *deprecated*

**Deprecated** — use
`spaceReputation.includeDescendants` instead. The flat form,
only honored alongside an explicit `spaceReputationId` `<uuid>`.

## Returns

**data** `Reaction[]`

Array of reaction records. Each includes `id`, `userId`, `reactionType`, `targetId`, `targetType`, `createdAt`. The `user` field is populated when user data is available; when `spaceReputation` is requested it carries an added `spaceReputation` number. See [Reputation](https://docs.sublay.io/v7/data-models/reputation.md).

**pagination** `PaginationMetadata`

Pagination metadata for the result set.

* `page` — current page number
* `pageSize` — number of results returned
* `totalItems` — total number of reactions matching the query
* `totalPages` — total number of pages
* `hasMore` — whether additional pages are available


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.