Complete setup instructions for integrating virtual try-on functionality into your e-commerce website
The DressUp Widget is a JavaScript library that automatically detects products on your e-commerce pages and provides AI-powered virtual try-on functionality. It's designed to be easy to integrate and requires minimal code changes to your existing website.
• Automatic product detection using AI
• Real-time virtual try-on processing
• Customizable appearance and messaging
• Mobile-responsive design
• Easy integration with any e-commerce platform
Before integrating the DressUp Widget, ensure you have:
Sign up for a DressUp account and obtain your API key from the dashboard.
Have an existing e-commerce website with product pages.
Ensure your product images are accessible via HTTPS URLs.
Your product pages should have proper Open Graph meta tags for title, description, and image.
Follow these simple steps to add the DressUp Widget to your website:
Include the DressUp Widget script in your HTML pages. Add this code before the closing </body>
tag:
Replace "YOUR_API_KEY" with your actual API key from the DressUp dashboard.
Add the data-elsy-tag="true"
attribute to your product images:
Ensure your product pages have proper Open Graph meta tags:
The widget will automatically detect products and show the virtual try-on interface when appropriate.
The widget uses AI to automatically detect if a page contains a suitable product for virtual try-on. Here's how it works:
data-elsy-tag="true"
Add data-elsy-tag="true"
to your product images:
If no data-elsy-tag is found, the widget will scan all images for alt text containing "VDressUp" (case-insensitive):
Dresses, shirts, jackets, pants, and other clothing items
Sofas, chairs, tables, and other furniture pieces
Rings, necklaces, earrings, and other accessories
Sneakers, boots, heels, and other footwear
Customize the widget appearance and behavior using data attributes:
Attribute | Description | Default | Example |
---|---|---|---|
data-api-key |
Your DressUp API key | Required | "dressup_abc123..." |
data-primary-color |
Primary color for buttons and highlights | "#6366f1" |
"#e91e63" |
data-secondary-color |
Secondary color for accents | "#8b5cf6" |
"#ad1457" |
data-position |
Widget position on screen | "bottom-right" |
"bottom-left" |
data-debug |
Enable debug logging | "false" |
"true" |
For more advanced customization, you can initialize the widget manually:
The DressUp Widget provides several methods for programmatic control:
Method | Description | Parameters | Example |
---|---|---|---|
show() |
Manually show the widget | None | widget.show() |
hide() |
Hide the widget | None | widget.hide() |
destroy() |
Remove the widget completely | None | widget.destroy() |
Property | Description | Type |
---|---|---|
isInitialized |
Whether the widget has been initialized | Boolean |
isVisible |
Whether the widget is currently visible | Boolean |
currentProduct |
Information about the detected product | Object |
Explore these working examples to see the DressUp Widget in action:
Common issues and their solutions:
The widget doesn't show up on your product pages.
• Check that your API key is correct and active
• Ensure product images have data-elsy-tag="true"
• Verify that your page has proper Open Graph meta tags
• Check browser console for error messages
• Enable debug mode to see detailed logs
The AI doesn't recognize your product as suitable for virtual try-on.
• Ensure your product title and description are clear and descriptive
• Use high-quality product images
• Check that your product falls into supported categories
• Contact support if you believe your product should be supported
Customer images fail to process or return errors.
• Ensure customer images are in supported formats (JPEG, PNG)
• Check that images are not too large (max 10MB)
• Verify that the customer image shows a person clearly
• Check your API key usage limits
Follow these best practices to get the most out of the DressUp Widget:
You're now ready to integrate the DressUp Widget into your e-commerce website! Start with the basic integration and gradually add customizations as needed.