Home > widget-integration > InstantSearchService > processWidgetConfig

InstantSearchService.processWidgetConfig() method

Process widget configuration before use.

Extension point for TS teams to customise search settings on a per-shop basis before any search or default-data operations begin.

Signature:

protected processWidgetConfig(config: SearchSettings$1): SearchSettings$1;

Parameters

Parameter

Type

Description

config

SearchSettings$1

Raw search settings from the block context

Returns:

SearchSettings$1

Processed search settings (identity by default)

Example

window.boostWidgetIntegration.extend('InstantSearchService', (InstantSearchService) => {
  return class CustomService extends InstantSearchService {
    protected processWidgetConfig(config) {
      // Enforce a minimum product limit for this shop
      return {
        ...config,
        suggestionBlocks: config.suggestionBlocks?.map(b =>
          b.type === 'products' ? { ...b, limit: Math.max(b.limit ?? 4, 6) } : b
        ),
      };
    }
  };
});