Fitting Widget Docs

API Reference

Complete reference for the Fitting Widget API

API Reference

window.fitting('init', options)

Initializes the widget. Call this once, before any other methods.

ParameterTypeRequiredDescription
apiKeystringYesYour widget API key
window.fitting('init', {
  apiKey: 'pk_live_xxx',
});

window.fitting('create', options)

Opens the virtual try-on experience.

ParameterTypeRequiredDescription
targetElementIdstringYesID of the container element where the widget renders
tryonItemsTryonItem[]YesArray of items available for try-on
model'balanced' | 'quality' | 'speed'NoRendering model (default: 'balanced')

TryonItem

FieldTypeDescription
productNamestringDisplay name of the garment
urlstringFull URL to the garment image
window.fitting('create', {
  targetElementId: 'widget-container',
  model: 'balanced',
  tryonItems: [
    {
      productName: 'Denim Jacket',
      url: 'https://example.com/jacket.png',
    },
  ],
});