---
metadata:
  - name: generator
    content: Diplodoc Platform v5.55.2
alternate:
  - https://yandex.com/dev/games/doc/en/sdk/defold/shortcut.md
  - https://yandex.com/dev/games/doc/hi/sdk/defold/shortcut.md
  - https://yandex.com/dev/games/doc/ko/sdk/defold/shortcut.md
  - https://yandex.com/dev/games/doc/ru/sdk/defold/shortcut.md
  - https://yandex.com/dev/games/doc/tr/sdk/defold/shortcut.md
  - https://yandex.com/dev/games/doc/vi/sdk/defold/shortcut.md
  - https://yandex.com/dev/games/doc/zh/sdk/defold/shortcut.md
  - href: en/sdk/defold/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 link to their desktop that leads to your 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 platform, internal browser rules, and [Yandex Games](https://yandex.com/games/){.external} restrictions. To verify that the shortcut can be added, use the `ysdk.shortcut.can_show_prompt()` method:

```lua showLineNumbers
ysdk.shortcut.can_show_prompt(function (self, can_show)
  if can_show then
    -- Here you can show the button for adding the shortcut.
  end
end)
```

## Opening a dialog box {#dialog-box-open}

After checking, you can show a button (or another UI element) in the game and make it call a dialog box for adding a shortcut when clicked. To call the dialog, use the `ysdk.shortcut.show_prompt()` method:

```lua showLineNumbers
ysdk.shortcut.show_prompt(function (self, accepted)
  if accepted then
    -- Here you can grant a reward for adding the shortcut.
  end
end)
```

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/button-git.md -->
<a href="https://github.com/yandex-games-plugins/defold">
  <span class="button">Repository</span>
</a>
<!-- endsource: en/_includes/button-git.md -->
