@perceptimagery/dita-configurator

0.2.1404 • Public • Published

Dita-configurator

| An embeddable package for Dita's 3D configurator

Usage

Prod: https://cdn.jsdelivr.net/npm/@perceptimagery/dita-configurator@latest

Dev : https://cdn.jsdelivr.net/npm/@perceptimagery/dita-configurator-staging@latest

<!-- index.html -->


<!-- Declare element with id `‘dita-3dconfig-element’` . This will get transformed after authentication -->
   <div
       id="‘dita-3dconfig-element’"
   ></div>




<!-- Inject `Dita configurator` from CDN -->
<script src="https://cdn.jsdelivr.net/npm/@perceptimagery/dita-configurator@latest?apikey={apikey}"></script>

<!-- call our sdk and load your sku  and add event listener for `add-to-cart` event -->
<!-- Our SDK exposes the Dita  -->
<script>
    function run() {
      const SKU = "YOUR-SKU-CODE";
      window.ditaConfigurator.load(SKU);
      window.ditaConfigurator.events.on("add-to-cart",(eventData)=>{
        console.log(eventData);
      })
    }

    // on document load execute our run function
    window.onload = () => { run(); } // to make sure our sdk and DOM is successfully loaded.
  
</script>

Readme

Keywords

none

Package Sidebar

Install

npm i @perceptimagery/dita-configurator

Weekly Downloads

113

Version

0.2.1404

License

UNLICENSED

Unpacked Size

1.52 MB

Total Files

4

Last publish

Collaborators

  • nilesh-percept
  • abhishek-percept