TRYHAIR · WIX HEADLESS · EARLY ACCESS

Virtual wig try-on for your Headless storefront

Install the merchant dashboard, connect your Wix store, and add a Try On button to the bottom-right corner of your product images.

Install TryHair for Wix Headless

Free installation. 100 welcome credits for eligible new installations, valid for 12 months. Successful generations cost 10 credits; failed generations are not charged.

1. Install the Headless application

  1. Sign in to Wix using the store owner’s account and open the install link above.
  2. Choose the Wix Headless project that contains your products. Review the permissions on Wix and confirm installation.
  3. Open TryHair in that project’s dashboard. The application provides Storefronts, Products, Analytics, and Credits & Billing.

This invitation installs the standalone Headless application. Frontend code integration is required. The existing Wix Editor/Studio product-page plugin follows its own installation flow.

2. Connect your own store and domain

  1. Open TryHair’s Storefronts page and review Storefront connections. TryHair attempts automatic discovery; use Find storefronts automatically to retry. Existing installations may need to accept the app update to grant Read OAuth Apps permission.
  2. Verified storefronts may already show Connected. Other candidates require you to confirm the domain and click Connect. Automatic discovery does not reconnect a domain you manually disconnected.
  3. If your storefront is missing, open Add connection. In the same Wix project, find the public OAuth client ID used by your existing storefront under Settings → Headless Settings. Enter it with the exact HTTPS origin, for example https://shop.example.com, with no path or trailing slash, and click Connect storefront.
  4. TryHair verifies that the OAuth client belongs to the same Wix site as the installation. You can connect multiple clients and domains, edit a domain directly, or disconnect an individual connection. Each subdomain requires its own connection.
  5. If installation is still connecting, open Credits & Billing and click Check again, then return to Storefronts.
  6. In Products, enable the wigs that should show Try On. Products that remain disabled will have no active try-on button.

Use your store’s public OAuth client ID. Never enter an app secret, client secret, or administrator API key. A Wix-managed storefront may need a developer to locate its existing client and token access.

3. Add the button to your product page

After connecting, open Storefronts → Add to your product page for the integration example. Integrate once in your shared product-page template: 100 products using that template do not need 100 separate installations. Pass the current product ID whenever the displayed product changes.

Your developer can use this adapter with plain HTML/CSS/JavaScript, React, or another frontend. Keep your existing Wix client and shopping session.

Add a mount element to the page: <div id="tryhair"></div>. In your existing async product-page initialization, load the script once and mount the widget:

// product.id must be the real Wix product ID.
// wixClient is the EXISTING authenticated storefront client.
if (!window.TryHairHeadless) {
  await new Promise((resolve, reject) => {
    const script = document.createElement('script');
    script.src = 'https://wix-tryhair-headless-qa-440112353894.us-central1.run.app/tryhair-headless.js';
    script.onload = resolve;
    script.onerror = reject;
    document.head.appendChild(script);
  });
}
const handle = window.TryHairHeadless.mount({
  element: document.getElementById('tryhair'),
  imageElement: document.querySelector('#product-image'),
  productId: product.id,
  getAccessToken: async () => {
    const { headers } = await wixClient.auth.getAuthHeaders();
    return headers.Authorization;
  }
});

Replace #product-image with the active product image selector in your page. The adapter positions the button inside the image’s bottom-right corner and follows scrolling and image resizing.

// When the displayed product changes:
handle.setProduct(nextProductId);
// When a gallery replaces its active <img> node:
handle.setImage(nextImageElement);
// When the page or component is removed:
handle.destroy();

Return the current visitor/member token from the same Wix client used for your store. Do not create a separate anonymous client solely for try-on. Product names, images, visibility, and enablement are checked on the server.

4. Try a product and check your balance

Open an enabled product, click Try On, choose a clear photo, and generate a preview. A successful generation uses 10 store credits. An unsuccessful generation does not use credits. Your balance and available purchase options are shown in Credits & Billing, and activity appears in Analytics.

A preview helps customers visualize the hairstyle. It does not guarantee exact lace blending, hairline, color, or physical fit.

Need help connecting your frontend?

A public product-page URL helps us inspect your storefront, but does not give TryHair access to edit or publish its source. Frontend code integration is still required.

Email contact@tryhair.ai with your storefront URL, frontend framework, and product-page structure. Share no secrets, API keys, or private visitor tokens.

If the client is reported as belonging to another store, confirm that the installed app, product catalog, and OAuth client are all in the same Wix project. If the button is absent, confirm the product is enabled, its active image is loaded, and the connected origin matches the storefront exactly.