Skip to content

Reactions

Users react to activities. Counts are denormalized (reaction_counts) and bumped only when a write actually affected a row — the read path never runs COUNT(*).

// client.reactions.add(kind, activityId, custom?) -> Reaction
const reaction = await client.reactions.add('like', activity.id)

There is no server-side reactions.add — reactions are always attributed to the authenticated user making the request, so they’re created only through the client SDK.

Two ways to remove: unreact drops the caller’s own reaction of a given kind (no reaction id needed); delete removes a specific reaction by its id.

// Remove your own reaction of a kind:
await client.reactions.unreact(activity.id, 'like')
// Or remove a specific reaction by id (e.g. one returned from reactions.add/list):
await client.reactions.delete(reaction.id)

Reaction counts and the caller’s own reactions arrive denormalized on every Activity returned from a feed read — no separate request needed:

activity.reaction_counts // Record<string, number>, e.g. { like: 4 }
activity.own_reactions // string[] | undefined — kinds the caller has already reacted with

For the full “who reacted” list (rather than just counts), use client.reactions.list or the paginated useReactionList hook:

// Page<Reaction>, newest first. `kind` optionally filters server-side.
const page = await client.reactions.list(activity.id, { kind: 'like', limit: 20 })