Configuration reference
Full reference for allTryOnWidget.init() options.
Base options
| Option | Type | Default | Description |
|---|---|---|---|
apiKey | string | required | Your Wearo API key (starts with wearo_) |
productSelector | string | See below | CSS selector targeting the product image |
brandColor | string | #000000 | Brand hex color. Applied to the overlay button and iframe. |
triggerText | string | Auto-detected | Button label. Auto-detects from <html lang>, URL, or navigator.language. |
triggerSelector | string | '' | Container override for the overlay button placement |
locale | 'en' | 'fr' | Auto-detected | Force language instead of auto-detecting |
Product identification
| Option | Type | Description |
|---|---|---|
productId | string | Product ID for analytics and conversion attribution |
variantId | string | Shopify variant ID |
Injection mode
| Option | Type | Default | Description |
|---|---|---|---|
injectionMode | 'overlay' | 'buybox' | 'both' | 'overlay' | Where the button is rendered |
buyboxSelector | string | '' | Anchor element near the Add to Cart button |
buyboxPosition | 'before' | 'after' | 'prepend' | 'append' | 'after' | Position relative to buyboxSelector |
buyboxBadge | BuyboxBadgeConfig | null | Optional badge on the buybox button (e.g. { text: 'NEW' }) |
Overlay button options
| Option | Type | Default | Description |
|---|---|---|---|
overlayTheme | 'glassmorphism' | ButtonThemeConfig | 'glassmorphism' | Visual theme for the overlay button |
overlayAlignment | 'center' | 'left' | 'right' | 'center' | Horizontal alignment on the image |
overlayAnchorSelector | string | '' | Custom anchor element for overlay positioning |
overlayAutoHide | boolean | false | Hide overlay until hover (desktop) |
overlayBottom | string | '16px' | Distance from the bottom of the image |
Buybox button theme
| Option | Type | Default |
|---|---|---|
buttonTheme | 'glassmorphism' | ButtonThemeConfig | 'glassmorphism' |
ButtonThemeConfig
Full control over button appearance:Default productSelector
When noproductSelector is provided, the widget tries these in order: