This Gist shows one method of setting up localStorage with Sapper using if (process.browser).
Here is the assumed file structure inside the src directory used in this Gist:
βββ src
βββ components
β βββ Btn.svelte
βββ routes
β βββ _layout.svelte
βββ stores
βββ store.js
Thank. You. So. Much.
This is beautiful :)