set

Function set 

Source
pub async fn set(key: &str, value: &str) -> Result<(), JsValue>
Expand description

Stores a value under the given key in Telegram’s secure storage.

Values are stored in an encrypted form and can be restored after the user reinstalls the application.

§Errors

Returns Err(JsValue) if the JavaScript call fails or secureStorage is missing.

§Examples

use telegram_webapp_sdk::api::secure_storage::set;
set("token", "123").await?;