Skip to content

WebApp Properties

The window.Telegram.WebApp object provides the following read-only properties to access the Mini App's runtime environment and status.

Basic Information

PropertyTypeDescription
initDataStringRaw initialization data string passed to the Mini App, used for server-side validation
initDataUnsafeWebAppInitDataParsed initialization data object containing user, chat, and other information
versionStringBot API version string, e.g., "8.0"
platformStringPlatform the Mini App is running on, e.g., "android", "ios", "web", "tdesktop"
isActiveBooleanWhether the Mini App is currently in the active state. Bot API 8.0+

Colors & Theme

PropertyTypeDescription
colorSchemeStringCurrent color scheme, either "light" or "dark"
themeParamsThemeParamsCurrent theme color parameters object
headerColorStringCurrent header bar color in hex format, e.g., "#ffffff"
backgroundColorStringCurrent background color
bottomBarColorStringBottom bar color. Bot API 7.10+

Viewport & Layout

PropertyTypeDescription
viewportHeightFloatVisible area height of the Mini App in pixels
viewportStableHeightFloatStable viewport height (unaffected by keyboard popup, etc.)
isExpandedBooleanWhether the Mini App is expanded to its maximum height
isFullscreenBooleanWhether the Mini App is in fullscreen mode. Bot API 8.0+
isOrientationLockedBooleanWhether screen orientation is locked. Bot API 8.0+
safeAreaInsetSafeAreaInsetSafe area insets object. Bot API 8.0+
contentSafeAreaInsetContentSafeAreaInsetContent safe area insets object. Bot API 8.0+

Interaction State

PropertyTypeDescription
isClosingConfirmationEnabledBooleanWhether the closing confirmation dialog is enabled
isVerticalSwipesEnabledBooleanWhether vertical swipe gestures are enabled. Bot API 7.7+

UI Components

PropertyTypeDescription
BackButtonBackButtonBack button control object
MainButtonBottomButtonMain button control object (large bottom button)
SecondaryButtonBottomButtonSecondary button control object. Bot API 7.10+
SettingsButtonSettingsButtonSettings button control object. Bot API 7.0+
HapticFeedbackHapticFeedbackHaptic feedback control object

Managers

PropertyTypeDescription
CloudStorageCloudStorageCloud storage manager
DeviceStorageDeviceStorageDevice storage manager. Bot API 8.0+
SecureStorageSecureStorageSecure storage manager. Bot API 8.0+
BiometricManagerBiometricManagerBiometric manager. Bot API 7.2+
AccelerometerAccelerometerAccelerometer. Bot API 8.0+
DeviceOrientationDeviceOrientationDevice orientation sensor. Bot API 8.0+
GyroscopeGyroscopeGyroscope. Bot API 8.0+
LocationManagerLocationManagerLocation manager. Bot API 8.0+