# Live Reaction

**Live Reactions** are interactions that users can perform during a livestream. These reactions can be anything, such as *like*, *dislike*, *love*, etc. The specific reaction types are determined by the client. The SDK provides convenient functions to add and query reactions.

### Create a live reaction

The `createReaction` function within liveReaction repository allows user to create a reaction to a livestream. This function requires following parameters:

* `referenceId` - The target post ID linked with a stream.
* `referenceType` - The referenceType should be 'post'.
* `reactionName` - The name of the reaction that you will add. Reaction names are case sensitive, i.e. "like" & "Like" are two different reactions.
* `streamId` - The streamID that you will add the reaction to.

{% tabs %}
{% tab title="iOS" %}
{% embed url="<https://gist.github.com/amythee/33071f4bf12158964f2d76e2535133f7>" %}
{% endtab %}

{% tab title="Android" %}
{% embed url="<https://gist.github.com/4b6ae9c27fb5b89cb722888583222dfa>" %}
{% endtab %}

{% tab title="Typescript" %}
{% embed url="<https://gist.github.com/4777084c23eedcbe6fba375bf9093d16>" %}
{% endtab %}
{% endtabs %}

### Observe Live Reactions

To observe reactions added to a stream, the `getReactions` requires a post ID of the post linked with the stream.

{% tabs %}
{% tab title="iOS" %}
{% embed url="<https://gist.github.com/amythee/b9e4a51b9384a08a9f5a0bc96bf3e9c6>" %}
{% endtab %}

{% tab title="Android" %}
{% embed url="<https://gist.github.com/2bff57ecb7b0d92ab775ea5753016b36>" %}
{% endtab %}

{% tab title="Typescript" %}
{% embed url="<https://gist.github.com/amythee/63b53fe60a3c3a1846c774080d98ca2a#file-getlivereactions-ts>" %}
{% endtab %}
{% endtabs %}
