Home > widget-integration > RecommendationAPI > (constructor)

RecommendationAPI.(constructor)

Creates a new RecommendationAPI instance with injected dependencies.

Initializes the API client by configuring the base URL from the application configuration and setting up the HTTP client through the parent class. All dependencies are automatically injected by the dependency injection framework.

Signature:

constructor(platformLoader: PlatformLoader, appService: AppService, b2bService: B2BService);

Parameters

Parameter

Type

Description

platformLoader

PlatformLoader

Platform loader for accessing platform-specific functionality and customer data. Injected automatically.

appService

AppService

Application service providing access to TAE app configuration, including the recommendation API base URL. Injected automatically.

b2bService

B2BService

B2B service for adding business-to-business specific parameters to recommendation requests. Injected automatically.

Remarks

The constructor automatically configures the HTTP client's base URL using appService.TAEAppConfig.recommendUrl, which should point to the Boost recommendation API endpoint for the current shop.