Alokai

InitLivePreviewProps

Configuration options for the initLivePreview() function.

interface InitLivePreviewProps {
	allowedOrigins?: string[];
	allowedOriginsAttributeName?: string;
	onComponentUpdated?: (...args: any[]) => void;
	page: Record<string, any>;
	previewTokenCookieName?: string;
	previewTokenParamName?: string;
	scriptId?: string;
	scriptSrc?: string;
	tailwindCompatStyles?: boolean;
}

Properties

NameRequiredTypeDescription
allowedOriginsOptionalstring[]A list of allowed origins for the live preview.
allowedOriginsAttributeNameOptionalstringThe attribute name for allowed origins.
onComponentUpdatedOptional(...args: any[]) => voidCallback to execute when the component is updated in SmartEdit.
pageRequiredRecord<string, any>A SmartEdit page object.
previewTokenCookieNameOptionalstringName of the cookie storing the SmartEdit preview token.
previewTokenParamNameOptionalstringName of the query parameter containing the SmartEdit preview token. 'cmsTicketId'
scriptIdOptionalstringUnique identifier for the webApplicationInjector script. 'smartedit-injector'
scriptSrcOptionalstringPath to the webApplicationInjector script.
tailwindCompatStylesOptionalbooleanWhether to inject a stylesheet which protects Tailwind's responsive re-show utilities (e.g. hidden md:flex) from the .hidden{display:none!important} rule that SmartEdit injects into the storefront iframe together with its editing overlay.

On this page