Home > widget-integration > PredictiveBundleAPI

PredictiveBundleAPI class

Fetches predictive bundle data and applies shop-specific request enrichment.

Override request-building methods to add custom segmentation, localization, or analytics parameters for Technical Support customizations.

Signature:

export declare class PredictiveBundleAPI extends BoostAPI 

Extends: BoostAPI

Example

window.boostWidgetIntegration.extend('PredictiveBundleAPI', (PredictiveBundleAPI) => {
  return class extends PredictiveBundleAPI {
    buildBundleQueryParams(params) {
      const enhanced = super.buildBundleQueryParams(params);
      return { ...enhanced, campaign_id: window.currentCampaignId };
    }
  };
});

Constructors

Constructor

Modifiers

Description

(constructor)(platformLoader, appService, b2bService, shopifyMarketHelper)

Constructs a new instance of the PredictiveBundleAPI class

Properties

Property

Modifiers

Type

Description

appService

protected

AppService

b2bService

protected

B2BService

platformLoader

protected

PlatformLoader

shopifyMarketHelper

protected

ShopifyMarketHelper

Methods

Method

Modifiers

Description

buildBundleQueryParams(params)

protected

Builds the request parameters sent to the predictive bundle endpoint.

getPredictiveBundles(productId)

Loads predictive bundles for a product.