10 seconds superfast Sprie integration 🔥🔥🔥
Pre-requisites
- Just have the apikey from sprie.
- Make sure the SKUs for the products are in sync with Sprie as well.
- Make sure your production url is configured properly with Sprie Settings (AllowList).
- Have a simple index.html getting served from a file server/web server.
Integrate
Copy paste this code in a html file
<!-- STEP 1. Load Sprie CDN Script with api key (most preferred way to integrate )-->
<script src="https://cdn.jsdelivr.net/npm/@perceptimagery/sprie-widget@latest?apikey={apikey}"></script>
<!-- STEP 2. Trigger -->
<button onclick="SprieSDK.Load('product-sku');">Preview</button>
Remember to replace the {apikey}
with a valid apikey that you received from sprie.
Explanation
- Integrate SprieSDK from CDN. Since its on CDN, Sprie will be cached in your browser and will work faster on subsequent page visits.
- Initialise SprieSDK with the apikey (from pre-requisites). Without this step, Sprie will throw error.
- Trigger Virtual Tryon Loader with SprieSDK
Load
method. SprieSDK is exported globally through window object.
List of all the methods and events are described in detail in the following doc pages.