Skip to content


Implements functionality that doesn't require state and can't be categorized.


To initialize the component, use the initUtils function:

import { initUtils } from '@tma.js/sdk';

const [utils] = initUtils();

MiniApp class is capable of opening links of different types. For example, it can open a link in an external browser not closing current Mini App, using method openLink:


In case, developer would like to open a link related to Telegram (starting with he could utilize such method as openTelegramLink. In this case Telegram application will handle such link on its own side:


In this case, Telegram application will open the group with name heyqbnk.


Sharing a URL is a common functionality in mini applications. To achieve this, a developer can use the shareURL method, which accepts the URL to be shared and optional text to append to the message after the URL.

When called, it opens the chat selector to share the URL.

utils.shareURL('', 'Look! Some cool app here!');


Currently, there is no native method to share anything directly. Therefore, this method utilizes the openTelegramLink method, which closes the app after being called. This method uses Share links under the hood.


Developers are allowed to read the text from the clipboard using the readTextFromClipboard method.

This method reads text from the clipboard and returns a string or null. Null is returned in cases:

  • The value in the clipboard is not text.
  • Access to the clipboard is not allowed.
utils.readTextFromClipboard().then((data) => {
  console.log('Clipboard data:', data);
  // Output: string or null

Methods Support

List of methods and parameters, which could be used in support checks: readTextFromClipboard and openLink.tryInstantView

Released under the MIT License.