Looks like storageApi don't persistent

I make a persistent state, but once I turn off extension sidebar, the persistent data is missing.

Sorry I confuse something.

The storage data is not missing after close sidebar. but missing when close extension, back to extension list

interesting thing is when a replace storageAPI with window.locationStorage. It’s fixed

Did you receive a success status in the result of the put operation?
Can you please confirm if you call the get method after the put operation you get the value back correctly?

As it turned out that the initializer can happen sooner than the craft object becoming ready, could you please try it with only using eventhandlers on buttons, to see if this is also caused by the race condition?

Yes, in dev mode it’s ok

not impossible, because it’s not a initializer, It save user’s token when click submit button

I meant in the app, because in dev mode the behavior is completely different. Could you try adding a button, which calls put, then get and prints the results of both to the UI and run it in the app?