Home > widget-integration > FilterStore > RESERVED_URL_PARAMS
FilterStore.RESERVED_URL_PARAMS property
Initializes URL parameter shortening maps from the provided configuration.
Creates bidirectional mappings between long and short parameter names for URL optimization. This reduces URL length while maintaining readability in the application code.
Signature:
static RESERVED_URL_PARAMS: Set<string>;
Remarks
The method parses each rule by finding the last ':' character, allowing colons in the long key name. Empty keys are skipped. Both maps are updated atomically via setState() to ensure consistency.
Example 1
Basic usage:
filterStore.initShortenMaps([
'productId:pid',
'categoryName:cat',
'priceRange:pr'
]);
Example 2
Extend to add custom URL shortening rules:
window.boostWidgetIntegration.extend('FilterStore', (FilterStore) => {
return class CustomFilterStore extends FilterStore {
initShortenMaps(shortenUrlParamList = []) {
// Add shop-specific default mappings
const customMappings = [
...shortenUrlParamList,
'shopCustomField:scf'
];
super.initShortenMaps(customMappings);
}
};
});