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

# TypeScript

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

To integrate the SDK into a game developed with TypeScript:

1. Install `npm` by following the instructions on the [Node.JS](https://nodejs.org/en/){.external} website.
1. To include SDK types, install the [@types/ysdk](https://www.npmjs.com/package/@types/ysdk){.external} package:

    ```console
    npm install --save @types/ysdk
    ```

1. Import the required SDK module types into your project files. For example, you can import the `ysdk` and `player` types like this:

    ```typescript showLineNumbers
    // Import necessary SDK module types.
    import type { SDK, Player } from 'ysdk';

    ...

    // Example of using the SDK with types.
    const ysdk: SDK = await YaGames.init();
    const player: Player = await ysdk.getPlayer();
    ```

---


<a href="https://www.npmjs.com/package/@types/ysdk">
  <span class="button">Repository</span>
</a>
