---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://yandex.com/dev/games/doc/en/sdk/sdk-shortcut.md
  - https://yandex.com/dev/games/doc/hi/sdk/sdk-shortcut.md
  - https://yandex.com/dev/games/doc/ko/sdk/sdk-shortcut.md
  - https://yandex.com/dev/games/doc/ru/sdk/sdk-shortcut.md
  - https://yandex.com/dev/games/doc/tr/sdk/sdk-shortcut.md
  - https://yandex.com/dev/games/doc/vi/sdk/sdk-shortcut.md
  - https://yandex.com/dev/games/doc/zh/sdk/sdk-shortcut.md
  - href: en/sdk/sdk-shortcut.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

# Desktop shortcut

<!-- 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 -->

Using a native dialog box, you can offer the user to add a shortcut to the desktop — a link to the game.


Before displaying the dialog box, make sure that the option is available.


## Checking whether adding a shortcut is available {#can-add-shortcut}

Whether the option is available depends on the device, internal browser rules, and [Yandex Games](https://yandex.com/games/){.external} platform restrictions.

To verify that the shortcut can be added, use the `ysdk.shortcut.canShowPrompt()` method:

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

const prompt = await ysdk.shortcut.canShowPrompt();

if (prompt.canShow) {
  // Here you can show the button for adding the shortcut.
}
```

## Opening a dialog box {#dialog-add-shortcut}

After checking, you can show a button (or another UI element) in the game that will open a dialog box for adding a shortcut when clicked.

To call the dialog, use the `ysdk.shortcut.showPrompt()` method:

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

const result = await ysdk.shortcut.showPrompt();

if (result.outcome === 'accepted') {
  // Here you can grant a reward for adding the shortcut.
}
```

The first time the method is called, a shortcut is created for the [Yandex Games](https://yandex.com/games/){.external} catalog. If it already exists, a shortcut with a link to the game will be created.


---

<!-- 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 -->
