Store App State in the URL to Build Shareable Links Without a Backend
A DEV Community article explains how developers can make shareable links without accounts, databases, or servers by encoding an app's entire state in the URL. It uses a spin wheel tool as an example, where a teacher can save entries and settings into a single link to share. The approach keeps the state in the hash fragment, which stays in the browser and is never sent to the server, improving privacy and enabling static hosting. The guide covers a compact state format with a version field, URL-safe Base64 encoding that handles multilingual text, and browser-native compression via CompressionStream. It also recommends validating incoming data and rendering it as plain text to prevent injection, plus warning users when links become too long for some apps.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in