How to save user login session for an hour on Figma?

My plugin prompts the user to login via entering email and password, after authentication; they can proceed to use the plugin.

However on closing and then reopening the plugin, it asks for login information again. I want to retain user login information in some storage from which it could be checked if a user had logged in within the previous hour to avoid asking login information again.

For websites, I’ve done this by saving user login information in the “Local Storage” of the browser. Can something similar be done for Figma desktop app?

Yes, you can use figma.clientStorage.

1 Like