salsify-experiences-sdk
Version:
SDK to be used by commerce websites to implement product experiences.
26 lines (25 loc) • 989 B
TypeScript
import { Logger, ErrorProperties } from '../../utils/logger';
export interface EventCallbackOptions {
/** Product identifier type that will be used to correlate published EC with products on your website
*
* This is often a standardized identifier such as a UPC (GTIN-12) or EAN (GTIN-13), or your website’s product SKU
*/
productIdType: string;
/** Product identifier */
productId: string;
/** Brand name */
brand?: string;
/** Product category hierarchy (from least specific to most specific)
*
* Example: ['Baby', 'Car Seats', 'Convertible Car Seats']
*/
category?: string | Array<string>;
}
/** @internal */
export default abstract class BaseEventHandler {
#private;
abstract eventName: string;
constructor(logger: Logger);
handle(options: EventCallbackOptions, extraProperties?: Record<string, unknown>): void;
protected handleValidationError(errorMessage: ErrorProperties['errorMessage']): void;
}