Home > widget-integration > PredictiveBundleModule
PredictiveBundleModule class
Wires predictive bundle blocks into TAE and bridges the legacy global open event.
Override this module to customize block discovery, controller connection, or validation of externally dispatched bundle payloads before the modal opens.
Signature:
export declare class PredictiveBundleModule
Example
export class CustomPredictiveBundleModule extends PredictiveBundleModule {
protected normalizeOpenEventBundleData(bundleData: unknown, expectedWidgetId: string) {
const normalized = super.normalizeOpenEventBundleData(bundleData, expectedWidgetId);
if (!normalized) {
return undefined;
}
return {
...normalized,
recommendation_type: normalized.recommendation_type || 'shop-custom',
};
}
}
Constructors
|
Constructor |
Modifiers |
Description |
|---|---|---|
|
Constructs a new instance of the |
Properties
|
Property |
Modifiers |
Type |
Description |
|---|---|---|---|
|
PredictiveBundleController | null | |||
|
ModuleRefImpl | |||
|
PredictiveBundleService | null | |||
|
|
Methods
|
Method |
Modifiers |
Description |
|---|---|---|
|
Connects a predictive bundle controller to a registered block. | ||
|
Removes global listeners and destroys tracked controllers. Safe to call multiple times during custom module teardown. | ||
|
Returns the most recently resolved predictive bundle controller. | ||
|
|
Logs initialization failures without breaking other widgets. | |
|
| ||
|
|
Normalizes bundle payloads coming from the global open event bridge. Override to accept additional payload fields or custom product metadata. | |
|
Initializes predictive bundle behavior for product-page blocks. | ||
|
Initializes predictive bundle behavior for instant-search blocks. | ||
|
|
Extracts a widget id from the TAE block id convention. | |
|
| ||
|
| ||
|
Registers TAE block listeners for predictive bundle and instant search surfaces. |