Contentful Personalization & Analytics
    Preparing search index...
    • Attaches the ContentfulOptimization preview panel to the DOM as a Web Component.

      Registers all custom elements, fetches audiences and optimization entries from Contentful, wires up state interceptors, and appends the panel to document.body.

      Parameters

      Returns Promise<void>

      Resolves once the panel has been appended to the document body.

      Error if the preview panel has already been attached.

      Error if optimization states cannot be obtained during registration.

      import attachOptimizationPreviewPanel from '@contentful/optimization-web-preview-panel'

      await attachOptimizationPreviewPanel({ contentful: client, optimization, nonce: undefined })