Install the Closku storefront widget
Add photo-based virtual try-on to your storefront with a CSV catalog import, an active widget configuration, and the Closku storefront script.
Reviewed by Closku documentation team ·
What the integration does
The storefront widget lets a shopper upload a photo and preview a garment from your Closku catalog. The supported setup uses CSV import and a storefront script; it does not provide live store catalog sync.
The current focus is virtual try-on. AI size recommendation is planned and is not currently available. The widget job response returns a visual preview, not measurements or a recommended size. Read the guide to try-on and size recommendations for the distinction.
Prepare the merchant and catalog
- Create a merchant account and choose an active plan.
- Import a small product sample in Products. Check names, images, variants, and active status before importing a larger catalog.
- Record the Closku product UUID from
GET /api/widget/products?merchantId=MERCHANT_UUID. Store product numbers and SKUs are not automatically Closku product IDs. - Arrange an active widget configuration with an explicit allowed storefront origin. An empty allowed-origin list denies production access. Give support the scheme and hostname, including a separate staging origin when needed.
Install the script and map a product
Copy your merchant script from SDK Config and insert it before the closing </body> tag on your product pages. Replace the example slug and UUID with your own values.
<script src="https://closku.com/widget/YOUR_STORE_SLUG.js" defer></script>
<div data-product-id="CLOSKU_PRODUCT_UUID">
<!-- Your product page content -->
</div>The loader inserts buttons next to elements with data-product-id. Map the value to the correct Closku product UUID; storefront form detection does not translate Shopify or WooCommerce IDs.
A custom button can call window.__CLOSKU__.openTryOn({ productId: "CLOSKU_PRODUCT_UUID" }) after window.__CLOSKU__?.isReady is true. Never put billing, database, or inference-provider secrets in the theme.
Verify the first try-on
- Open the configured storefront and check that the widget configuration request succeeds.
- Click the button and upload a photo you have permission to process. The widget accepts JPEG, PNG, or WebP up to 10 MB and submits a base64 data URL. Remote shopper-photo URLs are not supported.
- Confirm session creation for the same merchant, submission before session expiry, and status polling that reaches
completedwith aresultUrl. - Repeat on mobile and a second mapped product. Confirm a failure displays a useful message without blocking ordinary shopping.
- Review recorded usage in the merchant dashboard. A test submission starts processing and records activity.
Platform setup
Use the Shopify guide, Shopify theme setup, or WooCommerce guide for storefront context. Confirm the theme permits the script and required network requests. Custom storefronts use the same widget sequence; ask Closku before depending on a separate server API or outbound webhooks.
Next steps
Understand storefront access.
Read the current endpoint contract.
Related pages
Prepare and map catalog products.
Diagnose configuration or rendering failures.