A string with raw data transferred to the Mini App,
convenient for validating data.
WARNING: Validate data from this field before using it on
the bot's server.
An object with input data transferred to the Mini App.
WARNING: Data from this field should not be trusted.
You should only use data from initData on the bot's
server and only after it has been validated.
True, if the Mini App is expanded to the maximum
available height. False, if the Mini App occupies part of
the screen and can be expanded to the full height using
the expand() method.
True, if vertical swipes to close or minimize the Mini App
are enabled. False, if vertical swipes to close or minimize
the Mini App are disabled. In any case, the user will still
be able to minimize and close the Mini App by swiping
the Mini App's header.
Bot API 6.4+ A method that closes the native popup for
scanning a QR code opened with the showScanQrPopup
method. Run it if you received valid data in the event
qrTextReceived.
Bot API 7.7+ A method that disables vertical swipes to
close or minimize the Mini App. This method is useful if
your Mini App uses swipe gestures that may conflict with
the gestures for minimizing and closing the app.
Bot API 7.7+ A method that enables vertical swipes to
close or minimize the Mini App. For user convenience, it
is recommended to always enable swipes unless they
conflict with the Mini App's own gestures.
A method that expands the Mini App to the maximum
available height. To find out if the Mini App is expanded
to the maximum height, refer to the value of the
Telegram.WebApp.isExpanded parameter
Bot API 6.1+ A method that opens an invoice using the
link url. The Mini App will receive the event invoiceClosed
when the invoice is closed. If an optional callback
parameter was passed, the callback function will be called and the invoice status will be passed as the first
argument.
A method that opens a link in an external browser. The
Mini App will not be closed.
Bot API 6.4+ If the optional options parameter is passed
with the field try_instant_view=true, the link will be
opened in Instant View mode if possible.
Bot API 6.4+ A method that requests text from the
clipboard. The Mini App will receive the event
clipboardTextReceived. If an optional callback parameter
was passed, the callback function will be called and the
text from the clipboard will be passed as the first
argument.
A method that informs the Telegram app that the Mini
App is ready to be displayed.
It is recommended to call this method as early as
possible, as soon as all essential interface elements are
loaded. Once this method is called, the loading
placeholder is hidden and the Mini App is shown.
If the method is not called, the placeholder will be hidden
only when the page is fully loaded.
Bot API 6.9+ A method that shows a native popup
prompting the user for their phone number. If an
optional callback parameter was passed, the callback
function will be called when the popup is closed and the
first argument will be a boolean indicating whether the
user shared its phone number.
Bot API 6.9+ A method that shows a native popup
requesting permission for the bot to send messages to the user. If an
optional callback parameter was passed, the callback
function will be called when the popup is closed and the
first argument will be a boolean indicating whether the
user granted this access.
A method used to send data to the bot. When this
method is called, a service message is sent to the bot
containing the data data of the length up to 4096 bytes,
and the Mini App is closed. See the field web_app_data in
the class Message.
Bot API 7.10+ A method that sets the app's bottom bar
color in the #RRGGBB format. You can also use the
keywords bg_color, secondary_bg_color and bottom_bar_bg_color.
Bot API 7.8+ A method that opens the native story
editor with the media specified in the media_url
parameter as an HTTPS URL. An optional params
argument of the type StoryShareParams describes
additional sharing settings.
Bot API 6.2+ A method that shows message in a simple
alert with a 'Close' button. If an optional callback
parameter was passed, the callback function will be
called when the popup is closed.
Bot API 6.2+ A method that shows message in a simple
confirmation window with 'OK' and 'Cancel' buttons. If an
optional callback parameter was passed, the callback
function will be called when the popup is closed and the
first argument will be a boolean indicating whether the
user pressed the 'OK' button.
Bot API 6.2+ A method that shows a native popup
described by the params argument of the type
PopupParams. The Mini App will receive the event
popupClosed when the popup is closed. If an optional
callback parameter was passed, the callback function will
be called and the field id of the pressed button will be
passed as the first argument.
Bot API 6.4+ A method that shows a native popup for
scanning a QR code described by the params argument of
the type ScanQrPopupParams. The Mini App will receive
the event qrTextReceived every time the scanner catches
a code with text data. If an optional callback parameter
was passed, the callback function will be called and the
text from the QR code will be passed as the first
argument. Returning true inside this callback function
causes the popup to be closed. Starting from Bot API
7.7, the Mini App will receive the scanQrPopupClosed
event if the user closes the native popup for scanning a
QR code.
Bot API 6.7+ A method that inserts the bot's username
and the specified inline query in the current chat's input
field. Query may be empty, in which case only the bot's
username will be inserted. If an optional
choose_chat_types parameter was passed, the client
prompts the user to choose a specific chat, then opens
that chat and inserts the bot's username and the
specified inline query in the input field. You can specify
which types of chats the user will be able to choose from.
It can be one or more of the following types: users, bots,
groups, channels.