Home > widget-integration > RecommendationService > getRecommendationWidgetConfig

RecommendationService.getRecommendationWidgetConfig() method

Retrieves the configuration for a specific recommendation widget.

Looks up the widget in the TAE configuration based on the widget ID and its page type.

Signature:

getRecommendationWidgetConfig(widgetId: string): RecommendationWidget;

Parameters

Parameter

Type

Description

widgetId

string

The widget identifier following the page prefix naming convention (e.g., 'homepage-recommendations-1', 'productpage-related-1')

Returns:

RecommendationWidget

Widget configuration object containing params and widgetDesignSettings

Exceptions

Error if widget ID is invalid or not found in configuration for any supported page

Example

Get widget configuration:

const config = this.getRecommendationWidgetConfig('homepage-recommendations-1');
console.log(config.params.recommendationType); // 'best-selling'