telegram-apps icon indicating copy to clipboard operation
telegram-apps copied to clipboard

[Feature]: Adding SecureStorage and DeviceStorage

Open weareoneco opened this issue 8 months ago • 6 comments

Describe the solution you'd like

Add DeviceStorage to store data locally and SecureStorage to safely store data

weareoneco avatar May 11 '25 16:05 weareoneco

up

erfanmola avatar Jul 10 '25 19:07 erfanmola

up!

kokarevichs avatar Aug 07 '25 16:08 kokarevichs

I see that DeviceStorage and SecureStorage are not yet implemented in the SDK, and I rely heavily on this package in my Telegram Mini App. I’d like to ask: • Is there any workaround to access deviceStorage while still using the SDK (e.g., via postEvent, invokeCustomMethod, or a known safe method)? • Is there an estimated timeline for when support for deviceStorage might be added?

Would really appreciate any pointers or temporary solutions, since my app needs local client-side persistence right now.

Thanks again! 🙏

kokarevichs avatar Aug 07 '25 16:08 kokarevichs

up

nomanyDev avatar Sep 05 '25 20:09 nomanyDev

Why it's not up yet?

Update: Actually it's up. Here is docs: https://docs.telegram-mini-apps.com/platform/methods#web-app-device-storage-get-key

I think this issue can be closed. Correct me if I'm wrong

dikobay avatar Oct 27 '25 14:10 dikobay

Sorry, I was busy creating a new major version. SecureStorage and DeviceStorage will be implemented in the next week.

@dikobay the API you are referencing is the lowest level API. Yes, you can use it, but it is better to wait for the higher-level entities I mentioned - they will provide a more sensible API.

heyqbnk avatar Oct 27 '25 17:10 heyqbnk

Implemented in @tma.js/[email protected]. Let me know if something works wrong.

heyqbnk avatar Nov 18 '25 10:11 heyqbnk