meshkraft-vto

2.2.18 • Public • Published

ART Labs Meshkraft Web Virtual Try-On SDK

VTO SDK is a web application for ART Labs Virtual Try-On Engine to enhance its capabilites for user interaction. This application introduces various concepts such as dynamic version management, multiple event handling, customization for customer requirements and many more.

Install

You'll need to paste script code before closing </body> tag of your web page.

<script
  type="module"
  src="https://unpkg.com/meshkraft-vto/dist/index.min.js"
  data-meshkraft-key="YOUR_API_KEY"
></script>

Make sure to replace YOUR_API_KEY with your application token.

Basic Usage

After you place the script above, all you need to do is adding any button, a, div or any other clickable HTML element to your website, with your own style. The SKU that specified in the element can be a comma separated list to show multiple shoes.

<button data-meshkraft-vto-sku="YOUR_SKU">View in AR</button>

That's it 🎉.

Config

You should pass a stringified JSON object to script tag via data-meshkraft-config attribute. Available options are:

showAction - Boolean. Should show action block or not. Default is false.
actionButtonText - String. Title for the button. Default is Add to Cart.
actionButtonEventName - String. Event name to listen on button click. Default is add-to-cart.

logoUrl - String. Logo URL to use in upper-right corner. Default is null.
fontFamily - String. Font family name to use in SDK. Must be included in DOM. Default is Bebas Neue.
qrPopupTitle - String. Text to use in Desktop QR popup title. Default is Scan QR Code.
qrPopupSubtitle - String. Text to use in Desktop QR popup subtitle. Default is Point your mobile phone camera to the QR code below to experience Virtual Try-on.

<button
  data-meshkraft-vto-sku="Nike-Air-Max-90"
  data-meshkraft-vto-config='{"fontFamily":"Arial","qrPopupTitle":"Scan the Code","qrPopupSubtitle":"Scan the QR code below","logoUrl": "https://artlabs.ai/images/logo.svg", "showAction": true, "actionButtonText":"Add To Cart", "actionButtonEventName": "add-to-cart"}'
>
  Enter VTO
</button>

Events

There are two events that can be listened to. You can register an event listener to the window element via invoking the addEventListener method.

Added to Cart

When user clicks the Add to Cart button in AR banner, this event will be fired with SKU.

window.addEventListener('add-to-cart', (e) => {
  // Product added to cart
  console.log(e.detail.sku);
});

Error

When something goes wrong, this event will be fired with error message.

window.addEventListener('vto-error', (e) => {
  // VTO failed
  console.log(e.detail.message);
});

Full Example

<head>
  <script
    type="module"
    src="https://unpkg.com/meshkraft-vto/dist/index.min.js"
    data-meshkraft-key="YOUR_API_KEY"
  ></script>
</head>

<body>
  <button
    id="meshkraft-vto-button"
    data-meshkraft-vto-sku="Nike-Air-Max-90"
    data-meshkraft-vto-config='{"fontFamily":"Arial","qrPopupTitle":"Scan the Code","qrPopupSubtitle":"Scan the QR code below","logoUrl": "https://artlabs.ai/images/logo.svg", "showAction": true, "actionButtonText":"Add To Cart", "actionButtonEventName": "add-to-cart"}'
  >
    Enter VTO
  </button>
</body>

<script>
  window.addEventListener('add-to-cart', (e) => {
    console.log('Product added to cart :: ', e.detail.sku);
  });

  window.addEventListener('vto-error', (e) => {
    console.log('An error occured :: ', e.detail.message);
  });
</script>

Bundle Size

You will consuming minified and Gzipped or Brotli compressed version, depending on the browser.

┌─────────────────────────────────────────────┐
│                                             │
│   meshkraft-vto.min.js                      │
│   Bundle Size:  253.42 KB                   │
│   Gzipped Size: 77.24 KB                    │
│   Brotli size:  66.91 KB                    │
│                                             │
└─────────────────────────────────────────────┘

Initial bundle size is small but the essential parts of the VTO will be downloaded after user clicks to the button. The total size will be about 2MB to 10MB, depending on the 3D model.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.2.18280latest
2.2.13-beta.20beta

Version History

VersionDownloads (Last 7 Days)Published
2.2.18280
2.2.170
2.2.160
2.2.150
2.2.140
2.2.130
2.2.13-beta.20
2.2.13-beta-draco0
2.2.12-beta-draco0
2.2.110
2.2.100
2.2.90
2.2.80
2.2.70
2.2.60
2.2.50
2.2.5-beta.21
2.2.5-beta.10
2.2.40
2.2.30
2.2.20
2.2.10
2.2.00
2.2.0-rc.10
2.1.90
2.1.80
2.1.70
2.1.60
2.1.50
2.1.40
2.1.30
2.1.20
2.1.10
2.1.00
1.9.00
3.0.2-beta-memory-leak-fix0
3.0.1-beta-memory-leak-fix0
1.8.80
3.0.0-beta-memory-leak-fix0
1.8.70
2.0.3-HOKA0
2.0.2-HOKA0
1.8.60
2.0.1-HOKA1
2.0.9-FIBBL0
2.0.8-FIBBL0
2.0.0-HOKA0
2.0.7-FIBBL0
2.0.5-FIBBL0
2.0.4-FIBBL0
1.9.2-HOKA0
2.0.3-FIBBL0
2.0.2-FIBBL0
2.0.1-FIBBL0
2.0.0-FIBBL0
1.8.50
1.8.41
1.9.1-HOKA1
1.8.30
1.8.20
1.8.14-HOKA0
1.8.13-HOKA0
1.8.12-HOKA0
1.8.10
1.8.11-HOKA0
1.8.10-HOKA0
1.8.9-HOKA0
1.8.8-HOKA0
1.8.00
1.8.7-HOKA0
1.7.10
1.8.6-HOKA0
1.6.120
1.6.110
1.6.100
1.6.90
1.6.80
1.6.60
1.8.4-HOKA0
1.6.50
1.8.3-HOKA0
1.6.40
1.8.2-HOKA0
1.8.0-HOKA0
1.7.5-HOKA0
1.7.4-HOKA0
1.7.3-HOKA0
1.7.2-HOKA0
1.7.1-HOKA0
1.7.0-HOKA0
1.6.30
1.6.20
1.6.10
1.6.2-beta0
1.6.1-beta20
1.6.1-beta0
1.6.00
1.5.11-beta70
1.5.11-beta60
1.5.11-beta50
1.5.11-beta40
1.5.11-beta30
1.5.11-beta20
1.5.11-beta0
1.5.110
1.5.100
1.5.90
1.5.9-beta.40
1.5.9-beta.30
1.5.9-beta.20
1.5.9-beta.10
1.5.80
1.5.8-beta0
1.5.70
1.5.6-beta0
1.5.50
1.5.5-beta20
1.5.5-beta0
1.5.40
1.5.30
1.5.3-beta0
1.5.20
1.5.1-beta-20
1.5.10
1.5.0-beta-test-log20
1.5.0-beta-test-log0
1.5.00
1.4.2-beta-manual-trigger-60
1.4.2-beta-manual-trigger-50
1.4.2-beta-manual-trigger-40
1.4.2-beta-manual-trigger-20
1.4.2-beta-manual-trigger0
1.4.10
1.4.1-beta-core-exception0
1.4.00
1.3.3-beta-slider20
1.3.3-beta-slider0
1.3.20
1.3.2-beta-tablet0
1.3.10
1.3.1-beta20
1.3.1-beta0
1.3.00
1.3.0-beta0
1.2.100
1.2.90
1.2.80
1.2.70
1.2.60
1.2.50
1.2.40
1.2.2-data30
1.2.30
1.2.2-data20
1.2.2-data0
1.2.20
1.2.10
1.2.0-data70
1.2.0-data61
1.2.0-data50
1.2.0-data40
1.2.0-data30
1.2.0-data20
1.2.0-data10
1.2.0-data0
1.2.00
1.1.60
1.1.5-beta0
1.1.41
1.1.4-beta.20
1.1.4-beta.10
1.1.4-beta.00
1.1.30
1.1.20
1.1.10
1.1.00
1.1.0-beta.60
1.1.0-beta.50
1.1.0-beta.40
1.1.0-beta.30
1.1.0-beta.00
1.0.130
1.0.120
1.0.110
1.0.100
1.0.90
1.0.80
1.0.70
1.0.60
1.0.50
1.0.40
1.0.30
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i meshkraft-vto

Weekly Downloads

286

Version

2.2.18

License

UNLICENSED

Unpacked Size

506 kB

Total Files

7

Last publish

Collaborators

  • doruk_art
  • artlabs