Configuration

Control behavior, styling, and catalog strategy.

The widget API is intentionally small. Most retailers configure it once in the storefront theme and let Sillage handle recommendation quality, localization, and attribution.

Initialization options

NameTypeRequiredDefaultDescription
containerIdstringNo-ID of the DOM element where the widget mounts. Omit only when using floating app-snippet mode.
apiKeystringYes-Your sw_test_* or sw_live_* widget key.
locale'en' | 'ar'NoarWidget language and reading direction.
theme'light' | 'dark' | 'auto'NoautoVisual theme for the widget UI.
mountMode'inline' | 'floating'NoinlineUse 'floating' for app-store snippets that should create their own storefront mount.
catalog'auto' | MerchantProduct[]Noauto'auto' uses products connected to the API key. Pass an array only when this page should recommend from its own product list. Merchants only need product identity; Sillage enriches scent data.
apiBaseUrlstringNoscript originOverride only for previews or self-hosted API environments.
style.primaryColor#RRGGBBNo-Accent color. Low-contrast values fall back to Sillage gold.
style.borderRadiusstringNo-Controls widget shape for cards, buttons, and pills. Use a CSS value such as 16px.
style.fontFamilystringNo-Optional font stack inherited by the widget.
style.displayFontFamilystringNo-Optional font stack for display headings.
style.backgroundColor#RRGGBBNo-Optional widget background color.
style.surfaceColor#RRGGBBNo-Optional card and panel surface color.
style.textColor#RRGGBBNo-Optional primary text color.
branding.enabledbooleanNo-Opt into merchant branding. Requires a logo URL.
branding.logoUrlstringNo-Merchant logo URL shown in the launcher, entry, loading, and empty states.
branding.eyebrowTextstringNo-Optional replacement for the entry screen eyebrow label.
branding.launcherTextstringNo-Optional floating launcher label.
branding.ctaTextstringNo-Optional replacement for the entry CTA.
branding.resultsCtastringNo-Optional replacement for the powered-by footer CTA. Powered by Sillage remains visible.
onRecommendation(results) => voidNo-Callback after recommendations are returned.
onProductClick(product) => voidNo-Callback before opening a product URL.

Product source: connected catalog vs page products

DecisionConnected catalogPage products
What it meansThe widget recommends from products already linked to this API key.The page sends a product list directly when it initializes the widget.
Best forMain storefronts and production launches with stable inventory.Demos, seasonal edits, landing pages, or headless pages with a small product set.
Recommendation qualityBest: Sillage matches and enriches products from its perfume database.Good: Sillage matches product identity first; accords and notes are optional hints only.
MaintenanceKeep the connected catalog updated when inventory changes.The widget only sees the products passed on that page load.

Page products example

Pass page products

js

SillageWidget.init({
  containerId: 'sillage-widget',
  apiKey: 'sw_test_your_key',
  catalog: [
    {
      merchant_product_id: 'oud-velvet-50ml',
      name: 'Velvet Oud',
      house: 'Maison Parfum',
      price: 420,
      currency: 'SAR',
      product_url: 'https://store.example/products/velvet-oud'
    }
  ]
});

Merchant branding example

Merchant branding is opt-in. When enabled, the merchant logo appears in the widget chrome and the footer switches to a quieter attribution while still showing Powered by Sillage.

White-label the widget chrome

js

SillageWidget.init({
  containerId: 'sillage-widget',
  apiKey: 'sw_live_your_key',
  theme: 'auto',
  branding: {
    enabled: true,
    logoUrl: 'https://store.example/logo.svg',
    eyebrowText: 'Maison Parfum',
    launcherText: 'Find your scent',
    ctaText: 'Start scent finder',
    resultsCta: 'View your Sillage profile',
    style: {
      primaryColor: '#8a5a30',
      backgroundColor: '#fffaf2',
      surfaceColor: '#ffffff',
      textColor: '#1c1711',
      displayFontFamily: 'Georgia, serif'
    }
  }
});