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! You're the best!!!