---
metadata:
  - name: generator
    content: Diplodoc Platform v5.54.4
alternate:
  - https://yandex.com/dev/games/doc/en/sdk/sdk-review.md
  - https://yandex.com/dev/games/doc/hi/sdk/sdk-review.md
  - https://yandex.com/dev/games/doc/ko/sdk/sdk-review.md
  - https://yandex.com/dev/games/doc/ru/sdk/sdk-review.md
  - https://yandex.com/dev/games/doc/tr/sdk/sdk-review.md
  - https://yandex.com/dev/games/doc/vi/sdk/sdk-review.md
  - https://yandex.com/dev/games/doc/zh/sdk/sdk-review.md
  - href: en/sdk/sdk-review.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/games/doc/en/llms.txt

# Game rating

<!-- source: en/_includes/script-common.md -->
<!-- source: en/_includes/script/index-js.md -->

<!-- endsource: en/_includes/script/index-js.md -->

<!-- source: en/_includes/script/requirements-js.md -->

<!-- endsource: en/_includes/script/requirements-js.md -->

<!-- source: en/_includes/script/image-modal-js.md -->

<!-- endsource: en/_includes/script/image-modal-js.md -->
<!-- endsource: en/_includes/script-common.md -->

You can ask the user to rate the game and write a comment in a pop-up window. It appears when you request a rating.

Before requesting a game rating, make sure that the option is available for this user: they must be logged in and have not rated the game before.

For more information about working with ratings, see the [Reviews](https://yandex.com/dev/games/doc/en/console/reviews.md) page.

## Checking whether requesting a rating is available {#can-review}

To find out if you can request a game rating, use the `ysdk.feedback.canReview()` method.

It returns a `Promise<Object>` that changes its state to `resolved`. The returned object contains the `value` key set to `true/false`, which you can use to see whether a rating request is possible:

#|
|| **Value** | **Description** ||
|| `value: true` | You can request a rating. ||
||::{align="center"} `value: false` | You cannot request a rating.

The reason for rejection is returned as a string in the `reason` key:
- `NO_AUTH`: The user is not logged in.
- `GAME_RATED`: The user has already rated the game.
- `REVIEW_ALREADY_REQUESTED`: The request has already been sent, awaiting the user's action.
- `REVIEW_WAS_REQUESTED`: The request has already been sent, the user has taken action by either rating your game or closing the pop-up window.
- `UNKNOWN`: The request was not sent, an error occurred on the Yandex side. ||
|#


## Rating request {#request-review}


{% note alert %}

You can only request a game rating once per session. Be sure to use the [`ysdk.feedback.canReview()`](#can-review) method before executing the request.

{% endnote %}


To ask the user to rate the game and write a comment, use the `ysdk.feedback.requestReview()` method.

It returns a `Promise<Object>` that changes its state to `resolved`. The returned object contains the `feedbackSent` key set to `true/false`. You can determine the user's action from it:

#|
|| **Value** | **Description** ||
|| `feedbackSent: true` | The user rated the game. ||
|| `feedbackSent: false` | The user closed the pop-up window. ||
|#

If you did not use the `ysdk.feedback.canReview()` method before executing the request, the value `feedbackSent: false` may be accompanied by the `use canReview before requestReview` error.

#### Example {#request-review-example}

```javascript showLineNumbers
const ysdk = await YaGames.init();

const { value, reason } = await ysdk.feedback.canReview();

if (value) {
    const { sentFeedback } = ysdk.feedback.requestReview();
} else {
    console.log(reason);
}
```


---

<!-- source: en/_includes/sdk-support.md -->
{% note info %}

Our support team can help publish finished games on Yandex Games. If you have any questions about development or testing, ask them in the [Discord channel](https://discord.com/invite/wU4p3whr4T){.external}.

{% endnote %}

If you are facing an issue or have a question regarding the use of Yandex Games SDK, please contact support:

<!-- source: en/_includes/button-chat.md -->
<a href="https://yandex.com/chat/#/user/a4fa5c06-75db-9b38-6eea-b1673785f7d5">
  <span class="button">Write to chat</span>
</a>
<!-- endsource: en/_includes/button-chat.md -->
<!-- endsource: en/_includes/sdk-support.md -->
