How to use the JS editor to get sessionStorage and localStorage?

I want to get sessionStorage and localStorage provided by others through the JS editor.
But there was an error:

UncaughtPromiseRejection: sessionStorage is not defined

I have tried using, but it can only get the keys and value I provided myself;
What should I do?
The following is my example:

export default {
	test:async () => {
		let test = sessionStorage.getItem("test123")
		test = JSON.parse(test)
		return test

@chengfjin Unfortunately, we don’t give access to the window object - [Feature]: Access to the window object for js in apps · Issue #9978 · appsmithorg/appsmith · GitHub. Could you specify your use case in the above Github issue as well?

Also, maybe you can check if the data can be passed via query params and can be accessed using {{appsmith.URL.queryParams}} more info here - Appsmith Context Object - Appsmith

@chengfjin could you tell us why you’re trying to access the sessionStorage?