I'm new in Svelte and I'm trying to set some info into sessionStorage but it is throwing "sessionStorage is not defined". I realised that I received this error because it's running on the server side.
I created a component at /src/components/nav.svelte that uses /src/domain/auth/service.js and the error occurs in the last one.
Searching on the web I found that in this case I must use sessionStorage inside onMount function. Is that the right way?
How can I avoid that my code get a little mess?