Can anyone explain how to?
const student = JSON.stringify(Telegram.WebApp.initDataUnsafe);
const key = 'user_data';
Telegram.WebApp.CloudStorage.setItem(key, student, (error, success) => {
if (error) {
alert('Error storing JSON string:', error);
} else if (success) {
alert('JSON string stored successfully');
Telegram.WebApp.CloudStorage.getItem(key, (error, value) => {
if (error) {
alert('Error retrieving JSON string:', error);
} else {
alert('Retrieved JSON string:', value);
}
});
}
});
Did it according to https://core.telegram.org/bots/webapps#cloudstorage
but receive empty value and no errors every attempt. Shall I init CloudStorage on a server side?