2024-08-24 13:10:58 +02:00
export const metadata = {
title: "Reactions Extension",
description: "The Reactions Extension allows users to react to posts with emojis",
}
# Reactions Extension
The Reactions Extension allows users to express their reactions ("react") to posts with emojis. {{ className: 'lead' }}
## Federation
User reactions are (like every other entity) federated to all followers, and can be displayed to clients depending on the privacy settings of the associated [Note](/entities/note).
## Entity Definition
<Row>
<Col>
2024-12-24 14:01:09 +01:00
<Properties name="Reaction">
2024-08-24 14:29:54 +02:00
<Property name="type" type="string" required>
2024-08-24 13:10:58 +02:00
Must be `pub.versia:reactions/Reaction`.
</Property>
2024-08-24 13:34:30 +02:00
<Property name="author" type="URI" required typeLink="/types#uri">
2024-08-24 13:10:58 +02:00
URI of the [User](/entities/user) that is reacting.
</Property>
2024-08-24 13:34:30 +02:00
<Property name="object" type="URI" required typeLink="/types#uri">
2024-08-24 13:10:58 +02:00
URI of the [Note](/entities/note) attached to the reaction.
</Property>
<Property name="content" type="string" required>
Emoji content of reaction. May also be arbitrary text, or [Custom Emoji](/extensions/custom-emojis) if supported.
Clients are encouraged to disfavour text in favour of emoji where possible.
</Property>
</Properties>
</Col>
<Col sticky>
```jsonc {{ title: "Example Entity" }}
{
"id": "6f27bc77-58ee-4c9b-b804-8cc1c1182fa9",
2024-08-24 14:29:54 +02:00
"type": "pub.versia:reactions/Reaction", // [!code focus]
2024-08-24 13:10:58 +02:00
"uri": "https://example.com/actions/6f27bc77-58ee-4c9b-b804-8cc1c1182fa9",
"created_at": "2021-01-01T00:00:00.000Z",
"author": "https://example.com/users/6e0204a2-746c-4972-8602-c4f37fc63bbe", // [!code focus:3]
"object": "https://example.com/publications/f08a124e-fe90-439e-8be4-15a428a72a19",
"content": "😀",
}
```
</Col>
</Row>
2024-11-03 12:43:27 +01:00
## Note Collections
2024-08-24 13:10:58 +02:00
2024-11-03 12:43:27 +01:00
The Likes extension adds the following collections to the [Note](/entities/note) entity:
2024-08-24 13:10:58 +02:00
2024-11-03 12:43:27 +01:00
- `reactions`: A [URI Collection](/structures/collection#uri-collection) of all the reactions to the note.
2024-08-24 13:10:58 +02:00
2024-11-03 12:43:27 +01:00
```jsonc
{
"type": "Note",
...
"collections": {
...
"pub.versia:reactions/Reactions": "https://example.com/publications/f08a124e-fe90-439e-8be4-15a428a72a19/reactions"
2024-08-24 13:10:58 +02:00
}
2024-11-03 12:43:27 +01:00
}
```
2024-10-18 16:43:35 +02:00
## Interaction Types
<Note>
This section only applies to implementors of the [Interaction Controls Extension](/extensions/interaction-controls).
</Note>
This extension registers the following interaction types:
- `pub.versia:reactions#React`, for adding a Reaction to a Note.