@@ -93,7 +93,9 @@ When running outside Telegram in debug builds, `telegram_app!` loads mock
9393settings from ` telegram-webapp.toml ` .
9494- Configurable mock ` Telegram.WebApp ` for local development and testing.
9595- API helpers for user interactions, storage, device sensors and more.
96+
9697<p align =" right " ><a href =" #readme-top " >Back to top</a ></p >
98+
9799## Router
98100
99101The ` macros ` feature ships with a minimal in-memory [ ` Router ` ] ( src/router.rs )
@@ -142,7 +144,7 @@ telegram-webapp-sdk = { version = "0.2.12", features = ["macros", "yew", "mock"]
142144- ` yew ` &mdash ; exposes a ` use_telegram_context ` hook and a ` BottomButton ` component.
143145- ` leptos ` &mdash ; integrates the context into the Leptos reactive system.
144146- ` mock ` &mdash ; installs a configurable mock ` Telegram.WebApp ` for local development.
145- -
147+
146148<p align =" right " ><a href =" #readme-top " >Back to top</a ></p >
147149
148150## Quick start
@@ -221,7 +223,9 @@ The `mock` feature simulates a `Telegram.WebApp` instance, enabling local develo
221223let config = telegram_webapp_sdk::mock::MockConfig::default();
222224let ctx = telegram_webapp_sdk::mock::install(config)?;
223225```
226+
224227<p align =" right " ><a href =" #readme-top " >Back to top</a ></p >
228+
225229## User interactions
226230
227231Request access to sensitive user data or open the contact interface:
@@ -297,7 +301,9 @@ app.off_event(handle)?;
297301# Ok(())
298302# }
299303```
304+
300305<p align =" right " ><a href =" #readme-top " >Back to top</a ></p >
306+
301307## Sharing
302308
303309Share links, prepared messages, or stories and join voice chats:
@@ -336,7 +342,9 @@ off_click(&cb)?;
336342# Ok(())
337343# }
338344```
345+
339346<p align =" right " ><a href =" #readme-top " >Back to top</a ></p >
347+
340348## Cloud storage
341349
342350Persist small key-value pairs in Telegram's cloud using ` CloudStorage ` :
@@ -372,7 +380,9 @@ app.check_home_screen_status(|status| {
372380# Ok(())
373381# }
374382```
383+
375384<p align =" right " ><a href =" #readme-top " >Back to top</a ></p >
385+
376386## Event callbacks
377387
378388Callback registration methods return an ` EventHandle ` for later deregistration.
@@ -419,7 +429,9 @@ Supported background events:
419429| ` popupClosed ` | object ` { button_id: Option<String> } ` |
420430| ` qrTextReceived ` | scanned text ` String ` |
421431| ` clipboardTextReceived ` | clipboard text ` String ` |
432+
422433<p align =" right " ><a href =" #readme-top " >Back to top</a ></p >
434+
423435## Appearance
424436
425437Customize colors and react to theme or safe area updates:
@@ -449,7 +461,9 @@ app.off_event(content_handle)?;
449461# Ok(())
450462# }
451463```
464+
452465<p align =" right " ><a href =" #readme-top " >Back to top</a ></p >
466+
453467## Viewport
454468
455469Inspect the Mini App viewport size and subscribe to updates:
@@ -471,7 +485,9 @@ callback.forget();
471485# Ok(())
472486# }
473487```
488+
474489<p align =" right " ><a href =" #readme-top " >Back to top</a ></p >
490+
475491## Fullscreen and orientation
476492
477493Control the Mini App display and screen orientation:
@@ -489,7 +505,9 @@ app.exit_fullscreen()?;
489505# Ok(())
490506# }
491507```
508+
492509<p align =" right " ><a href =" #readme-top " >Back to top</a ></p >
510+
493511## Haptic feedback
494512
495513Trigger device vibrations through Telegram's [ HapticFeedback] ( https://core.telegram.org/bots/webapps#hapticfeedback ) API:
@@ -505,7 +523,9 @@ notification_occurred(HapticNotificationType::Success)?;
505523selection_changed()?;
506524# Ok::<(), wasm_bindgen::JsValue>(())
507525```
526+
508527<p align =" right " ><a href =" #readme-top " >Back to top</a ></p >
528+
509529## Device storage
510530
511531Persist lightweight data on the user's device:
@@ -519,7 +539,9 @@ let value = get("theme").await?;
519539# Ok(())
520540# }
521541```
542+
522543<p align =" right " ><a href =" #readme-top " >Back to top</a ></p >
544+
523545## Secure storage
524546
525547Store sensitive data encrypted and restorable:
@@ -552,7 +574,9 @@ if is_biometric_available()? {
552574# Ok(())
553575# }
554576```
577+
555578<p align =" right " ><a href =" #readme-top " >Back to top</a ></p >
579+
556580## Location manager
557581
558582Retrieve user location and react to related events via Telegram's location manager:
@@ -572,7 +596,9 @@ on_location_requested(&cb)?;
572596cb.forget();
573597# Ok::<(), wasm_bindgen::JsValue>(())
574598```
599+
575600<p align =" right " ><a href =" #readme-top " >Back to top</a ></p >
601+
576602## Device sensors
577603
578604Access motion sensors if the user's device exposes them.
@@ -589,7 +615,9 @@ stop()?;
589615Callbacks for sensor lifecycle events are available through ` on_started ` ,
590616` on_changed ` , ` on_stopped ` , and ` on_failed ` functions for accelerometer,
591617gyroscope, and device orientation sensors.
618+
592619<p align =" right " ><a href =" #readme-top " >Back to top</a ></p >
620+
593621## Init data validation
594622
595623Validate the integrity of the ` Telegram.WebApp.initData ` payload on the server.
@@ -619,19 +647,25 @@ TelegramWebApp::validate_init_data(
619647
620648# Ok::<(), Box<dyn std::error::Error>>(())
621649```
650+
622651<p align =" right " ><a href =" #readme-top " >Back to top</a ></p >
652+
623653## API coverage
624654
625655<!-- webapp_api_summary:start -->
626656** WebApp API coverage:** version ` 9.2 ` matches the latest Telegram WebApp API release ` 9.2 ` . Synced in commit [ 92abbf7] ( https://github.com/RAprogramm/telegram-webapp-sdk/commit/92abbf7 ) (recorded on 2025-09-21).
627657<!-- webapp_api_summary:end -->
628658
629659See [ WEBAPP_API.md] ( ./WEBAPP_API.md ) for a checklist of supported Telegram WebApp JavaScript API methods and features.
660+
630661<p align =" right " ><a href =" #readme-top " >Back to top</a ></p >
662+
631663## Changelog
632664
633665See [ CHANGELOG.md] ( ./CHANGELOG.md ) for release notes.
666+
634667<p align =" right " ><a href =" #readme-top " >Back to top</a ></p >
668+
635669## License
636670
637671` telegram-webapp-sdk ` is licensed under either of
@@ -640,7 +674,9 @@ See [CHANGELOG.md](./CHANGELOG.md) for release notes.
640674- MIT license ([ LICENSE-MIT] ( LICENSE-MIT ) or < http://opensource.org/licenses/MIT > )
641675
642676at your option.
677+
643678<p align =" right " ><a href =" #readme-top " >Back to top</a ></p >
679+
644680## Metrics
645681
646682![ Metrics] ( https://github.com/RAprogramm/infra-metrics-insight-renderer/blob/main/metrics/telegram-webapp-sdk.svg )
0 commit comments