Front End Integration
Last updated
Was this helpful?
The Spectrum front end is designed to be integrated into the front end of your ecommerce website. All necessary front end files will be delivered via the Spectrum CDN and are rendered dynamically within an HTML element.
The Spectrum team will provide the full URL to fill in the [ClientHandle]. The [SpectrumCdnEnvironment] base URLs are listed in the Environments page.
<script type="module" src="[SpectrumCdnEnvironment]/[ClientHandle]/frontend/js/customizer.esm.js"/>This is where the customizer experience will load on the page. Any surrounding container elements on the PDP should be 100% width to allow for responsive content.
<div id="spectrum-customizer"></div>The customizer will launch automatically on first load and set a relaunch function to window.spectrumInitializeCustomizer. If the customizer is closed by the user (or via the add to cart flow), you can relaunch it by calling await window.spectrumInitializeCustomizer(). Ensure that the id=“spectrum-customizer” div exists and window variables are updated as needed before relaunching.
Last updated
Was this helpful?
Was this helpful?