state-in-url is a TypeScript-first library designed to store and synchronize application state directly in the browser URL, preserving both the structure and types of the data. It enables developers to represent complex state—such as objects, arrays, and dates—in the query string, allowing every state to be shareable via a URL and persistent across page reloads. The tool aims to eliminate boilerplate and the need for providers, offering a streamlined API that mirrors React's useState, but with the URL as the backing store.
This hook allows components to read from and write to the URL's query parameters, ensuring that changes in state are immediately reflected in the URL and vice versa. Developers can define their application's state using TypeScript types, ensuring type safety throughout the process. The tool supports updating state both immediately and on demand, syncing changes to the URL as needed. It also allows for the creation of reusable custom hooks for managing slices of state, and includes helpers like encodeState and decodeState for use in other frameworks or plain JavaScript.
state-in-url is lightweight, with a gzipped size of approximately 2 KB and no dependencies. It is distributed under the MIT license and can be installed via npm. The tool is tested with unit and cross-browser end-to-end suites, emphasizing reliability. It is suitable for developers seeking to build deep links, share stateful URLs, and synchronize state across unrelated client components without additional setup or context providers. The library is open source, and its source code is available for review and contribution.
state-in-url sits in PulseGate's Frameworks & SDKs category. It focuses on synchronizing and sharing application state via URLs without losing type safety or requiring extra boilerplate. It is built as an open-source project for react and Next.js developers. state-in-url is open source under the MIT license. The product ships for the command line.
asmyshlyaev177 builds and maintains state-in-url, and the product first shipped in 2024. Development happens publicly on GitHub with 417 stars and 17 commits in the last 90 days. Key capabilities include type-safe state, URL state sync, and react integration.
Latest indexed changes and source events
asmyshlyaev177/state-in-url verified by the PulseGate indexer
Other apps tracked under the same category.