# Reactions Extension

Lets users react to notes with emojis.

Extension name: `pub.versia:reactions`

The Reactions Extension allows users to express their reactions ("react") to notes with emojis.

This extension requires [`pub.versia:social@1`](/extensions/social), which defines [Notes](/extensions/social#note).

## Definition

- Type: `"pub.versia:reactions/Reaction"`
- Fetch: `GET /.versia/v0.7/entities/pub.versia:reactions/Reaction/{id}`

**Fields**

- `type` (`string`, required): **MUST** be `pub.versia:reactions/Reaction`.

- `author` (`Reference`, required): [Reference](/entities#reference) to the [User](/entities/user) that is reacting.

- `target` (`Reference`, required): [Reference](/entities#reference) to the [Note](/extensions/social#note) attached to the reaction.

- `content` (`string`, required): Emoji content of reaction. Can also be arbitrary text, or the `name` of a [Custom Emoji](/extensions/custom-emojis), such as `:happy_face:`, with a matching entry in this Reaction's own `pub.versia:custom_emojis` extension. **MUST** be at least 1 character long.

  Receivers **MAY** drop a Reaction they cannot display.

Inherited from [Entity](/entities):

- [`id`](/entities#entity-id) (`string`, required)
- [`created_at`](/entities#entity-created-at) (`RFC3339`, required)
- [`updated_at`](/entities#entity-updated-at) (`RFC3339`)
- [`extensions`](/entities#entity-extensions) (`Extensions`)

```jsonc title="Example Entity"
{
    "id": "033fsr7ggg004",
    "type": "pub.versia:reactions/Reaction",
    "created_at": "2021-01-01T00:00:00Z",
    "author": "example.org:033wv9k6n0007",
    "target": "example.com:0337hp246t002",
    "content": "😀"
}
```

## Behavior

To undo a Reaction, a [Delete](/entities/delete) entity **MUST** be used. The `deleted` property of the Delete entity **MUST** be a [Reference](/entities#reference) to the Reaction to be removed.

## Delivery and Access

A sender **MUST** [deliver](/federation#delivery) Reactions to the author of the [Note](/extensions/social#note) and, if the Note is public, to the subscribers of the reacting user.

Any instance that [may fetch](/extensions/social#delivery-and-access) the Note, and the instance of the Note's author, may fetch a Reaction.

Reactions can be displayed to clients depending on the privacy settings of the associated Note.

## Collections

The Reactions extension adds the following collections to the [Note](/extensions/social#note) entity:

- `pub.versia:reactions/Reactions`: [Reference Collection](/structures/collection#reference-collection) of all the reactions to the note.

## Interaction Types

This extension registers the following [interaction types](/extensions/interaction-controls#interaction-types):

- `pub.versia:reactions/react`, for adding a Reaction to a Note.
