Current parsed query parameters (syncs with location.search).
The window object supplied to the manager.
Deletes a parameter by key, immediately updating the browser URL.
Gets a query parameter's value by key, parsing it optionally as a number, boolean, or array. If the parameter does not exist, returns defaultValue (default: 0).
Parameter name.
Optional
parser: "number" | "boolean" | "array"If given, parse the value accordingly.
Optional
defaultValue: any = 0Default fallback if not found in query.
Creates and returns a URL instance representing the current page, but with the given updates applied. Does not mutate the real browser URL.
Key/values to set/delete (undefined = delete).
Sets a parameter and updates the URL in the browser.
Bulk set/delete for multiple keys. For every property on updates, if value is undefined, deletes it; else sets it.
Key/value pairs (undefined values will trigger deletion).
URLManager – Utility for managing and mutating browser URL query parameters in a type-safe, structured way.
Encapsulates URL query string parsing, updating, and browser history URL manipulation, providing an easy-to-use API for reading, updating, deleting, and previewing query parameters.
Param: window
The browser window object. Required for location/history access.
Method
get(key, parser?, defaultValue?) - Fetches a parameter, with optional type/array parsing and a default fallback.
Method
set(key, value) - Sets a query parameter key to value and updates the URL.
Method
delete(key) - Removes a parameter by key and updates the URL.
Method
update(updates) - Performs a bulk set/delete on multiple parameters, then updates the URL.
Method
getUpdatedURLString(updates) - Returns a new URL instance with updates applied, but does not modify the real URL.
Example