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
| Property | Type | Description |
|---|---|---|
initData | String | Raw initialization data string passed to the Mini App, used for server-side validation |
initDataUnsafe | WebAppInitData | Parsed initialization data object containing user, chat, and other information |
version | String | Bot API version string, e.g., "8.0" |
platform | String | Platform the Mini App is running on, e.g., "android", "ios", "web", "tdesktop" |
isActive | Boolean | Whether the Mini App is currently in the active state. Bot API 8.0+ |
Colors & Theme
| Property | Type | Description |
|---|---|---|
colorScheme | String | Current color scheme, either "light" or "dark" |
themeParams | ThemeParams | Current theme color parameters object |
headerColor | String | Current header bar color in hex format, e.g., "#ffffff" |
backgroundColor | String | Current background color |
bottomBarColor | String | Bottom bar color. Bot API 7.10+ |
Viewport & Layout
| Property | Type | Description |
|---|---|---|
viewportHeight | Float | Visible area height of the Mini App in pixels |
viewportStableHeight | Float | Stable viewport height (unaffected by keyboard popup, etc.) |
isExpanded | Boolean | Whether the Mini App is expanded to its maximum height |
isFullscreen | Boolean | Whether the Mini App is in fullscreen mode. Bot API 8.0+ |
isOrientationLocked | Boolean | Whether screen orientation is locked. Bot API 8.0+ |
safeAreaInset | SafeAreaInset | Safe area insets object. Bot API 8.0+ |
contentSafeAreaInset | ContentSafeAreaInset | Content safe area insets object. Bot API 8.0+ |
Interaction State
| Property | Type | Description |
|---|---|---|
isClosingConfirmationEnabled | Boolean | Whether the closing confirmation dialog is enabled |
isVerticalSwipesEnabled | Boolean | Whether vertical swipe gestures are enabled. Bot API 7.7+ |
UI Components
| Property | Type | Description |
|---|---|---|
BackButton | BackButton | Back button control object |
MainButton | BottomButton | Main button control object (large bottom button) |
SecondaryButton | BottomButton | Secondary button control object. Bot API 7.10+ |
SettingsButton | SettingsButton | Settings button control object. Bot API 7.0+ |
HapticFeedback | HapticFeedback | Haptic feedback control object |
Managers
| Property | Type | Description |
|---|---|---|
CloudStorage | CloudStorage | Cloud storage manager |
DeviceStorage | DeviceStorage | Device storage manager. Bot API 8.0+ |
SecureStorage | SecureStorage | Secure storage manager. Bot API 8.0+ |
BiometricManager | BiometricManager | Biometric manager. Bot API 7.2+ |
Accelerometer | Accelerometer | Accelerometer. Bot API 8.0+ |
DeviceOrientation | DeviceOrientation | Device orientation sensor. Bot API 8.0+ |
Gyroscope | Gyroscope | Gyroscope. Bot API 8.0+ |
LocationManager | LocationManager | Location manager. Bot API 8.0+ |
