Attaches the Optimization preview panel to the DOM as a Web Component.
Registers all custom elements, fetches audiences and personalizations from
Contentful, wires up state interceptors, and appends the panel to
document.body.
Parameters
args: AttachOptimizationPreviewPanelArgs
Configuration containing the Contentful client, Optimization instance, and optional CSP nonce.
Returns Promise<void>
Resolves once the panel has been appended to the document body.
Throws
Error if the preview panel has already been attached.
Throws
Error if optimization states cannot be obtained during registration.
Attaches the Optimization preview panel to the DOM as a Web Component.
Registers all custom elements, fetches audiences and personalizations from Contentful, wires up state interceptors, and appends the panel to
document.body.