TryItOn
Guides

Embed the Try-On Widget on Your Storefront

Embed the TryItOn try-on widget in an iframe with a site key: set allowed hosts, pass the garment image and hide TryItOn branding.

The storefront widget is a ready-made try-on window you put on a product page in an <iframe>. The shopper uploads a photo, and the widget shows the result. You don't build any UI and your API key never reaches the browser.

Use it when you want a try-on button fast. If you want your own interface, use the REST API or the SDKs instead. The widget is a hosted page, not part of the versioned /api/v1 contract, so its look can change.

Create a site key

A site key identifies your account to the widget. It is public: it sits in the iframe URL, so don't treat it as a secret. That is why you lock it to your domains.

  1. Open the dashboard, go to Developer API, and find Site Keys.
  2. Click Create new Site Key, name it, and add the hosts that may embed it (for example shop.example.com).
  3. Copy the key. The full value is shown once, and the table afterwards shows it masked.

An account can have up to 10 site keys, and each key can list up to 10 allowed hosts.

A key with no allowed hosts can be embedded on any website. Always add your hosts. When hosts are set, the widget refuses to load on other sites and only allows framing from them.

Create one key per site you serve. Usage from all your keys is billed to the same account and credit balance.

Add the widget

Point an iframe at the widget with your site key and the product image:

<iframe
  src="https://tryiton.now/embed/tryon-clothes?site_key=YOUR_SITE_KEY&garment_image=https%3A%2F%2Fshop.example.com%2Fdress.jpg&product_id=123&product_title=Slip%20dress"
  width="100%"
  height="640"
  style="border:0"
></iframe>
ParameterMeaning
site_keyYour site key. Required.
garment_imageURL of the product image to try on. URL-encode it.
category, subcategoryOptional hints for what the garment is.
product_id, product_titleYour own product reference, used for analytics.
visitor_idAn anonymous id you generate per shopper, used for per-shopper limits and analytics.

The widget posts messages to the parent page, so you can react to it: tryiton:add-to-cart when the shopper taps add to cart, tryiton:busy while a try-on runs, and tryiton:live when the live camera opens or closes.

Hide TryItOn branding

By default the widget shows the TryItOn logo. A site key can hide it:

  1. In Site Keys, edit the key and turn on Hide TryItOn branding.
  2. Save. The change reaches the widget right away.
  • It needs a paid plan that includes it. Credit packs alone don't qualify. The dashboard shows an error if your plan doesn't include it, and the key stays branded.
  • It follows your plan. If the subscription ends or moves to a plan without it, branding comes back on its own. Nothing needs changing on your site.
  • It is set per key, so you can hide branding for one site and keep it on another.

Hiding branding removes the TryItOn logo and name. It does not remove the AI disclosure: result images keep a plain "AI-generated" label, and shared or downloaded copies are always stamped. The EU AI Act requires that disclosure, so it can't be turned off.

Shopify stores get this setting through the Shopify app, per store, not through site keys.

Live camera

The widget's live camera try-on is currently available to Shopify merchants only, through the TryItOn Shopify app. On other sites the widget offers photo try-on.

To offer a live camera on your own storefront, build it with the Live Try-On API and tryiton-live. You design the interface yourself, so there is no TryItOn branding to hide, and you show your own AI disclosure.

Billing

Widget try-ons spend credits from the account that owns the site key, at the same price as the API. See Credits & Pricing and Rate Limits.

On this page