✦Style Swap AI/Hydrogen & Next.js Headless
⚡ HEADLESS ARCHITECTURE

Headless Try-On Architecture: Hydrogen, Next.js & Framer with Style Swap AI

Style Swap AI is purpose-built for headless Shopify storefronts: HMAC-verified App Proxy calls, typed DOM events, and Storefront Cart API bundles—without sacrificing Core Web Vitals or shopper privacy.

Test Any Shopify Product URL Live at /demo →Install on Shopify (50 Free Try-On Credits) ↗Canonical Guide on ShopCanvas.ai ↗
✦ INTERACTIVE FRAMER MARKETPLACE PLUGIN INSPECTOR

Customize `StyleSwapTryOn.tsx` Property Controls & Preview Live on a Framer Canvas

✓ Approved on Framer Marketplace · 100% On-Device Privacy
⚡ Framer Property Controls (`StyleSwapTryOn.tsx`)CMS Bound
1. Button Theme Accent Color
2. Default Studio Model Preset
3. Before / After Curtain Split52%
Live Component Button Preview (Editorial Studio)
Cream Quilted Bomber · $210
✦ Virtual Try-On
After AI Try-On on Framer PDP: Cream Quilted Bomber Jacket
Before AI Try-On on Framer PDP
Cream Quilted Bomber flat-lay
Synced via Shop Canvas / Shopify Storefront API
Preset: Editorial Studio · Dispatches seed-try-on:add-to-cart
🎬 LIVE UAE & GCC 10S LOOKBOOK VIDEO ENGINE·FULL-BODY + 100MM MACRO + 3×3 BENTO GRID

From Casual Mirror Selfies to 10-Second Dubai Luxury Lookbook Reels

Cast across a cosmopolitan UAE lineup (Emirati/Arab, Afro-Arab, South Asian, Mediterranean & East Asian models) with automatic modest-luxury restyling, 100mm macro fabric close-ups, and Sweet Pants SS25–inspired 3×3 Editorial Bento Lookbook Grids.

▶ Mode A: 10s Full-Screen 9:16 Multi-Shot Reel9:16 · 10.0s Loop
Original mirror selfie input
Input Garment
Mirror Selfie → Studio
Emirati / Levantine Arab Studio · Warm Caramel-Olive (Fitzpatrick IV)Kling v4.0 · 10s Multi-Keyframe + 3×3 Grid

Dusty Slate-Blue Brushed Mohair Cardigan & Ivory Palazzo Trousers

Restyled from a cropped mirror selfie into a full-length Dubai modest-luxury studio look with mother-of-pearl buttons & lettuce-edge cuffs.

Dusty Slate-Blue Brushed Mohair Cardigan & Ivory Palazzo Trousers Full-Body Studio Keyframe
1. Full-Body Studio
00:00–00:03.5s
Dusty Slate-Blue Brushed Mohair Cardigan & Ivory Palazzo Trousers 100mm Macro Detail Keyframe
2. 100mm Macro Detail
00:03.5–00:07.0s
Dusty Slate-Blue Brushed Mohair Cardigan & Ivory Palazzo Trousers 3x3 Editorial Bento Grid Keyframe
3. 3×3 Bento Grid
5 Static + 4 Live Tiles
UAE Modest-Luxury Guardrail: Paired with full-length tailored pearl-ivory wide-leg trousers (#F8F6F0) and closed-toe leather mules.Download 10s MP4 ↓
EXECUTIVE SUMMARY & TECHNICAL SPECIFICATION

Executive Summary: Unlock Headless Try-On Without Platform Constraints

Style Swap AI decouples try-on from the Shopify theme, so fully custom Hydrogen, Next.js, and Framer storefronts can deliver 8–12 second AI outfit previews with zero photo storage. This reference architecture covers the HMAC-verified App Proxy, the three custom DOM events, and multi-SKU bundle checkout via the Storefront Cart API.

  • Signed App Proxy routes at /apps/try-on/* keep inference and shopper photos server-side; your storefront ships only a lightweight launcher, so LCP stays clean and CLS is zero.
  • Typed DOM events—seed-try-on:open, seed-try-on:add-to-cart, seed-try-on:complete-look-add—let any Hydrogen, Next.js, or Framer component open the modal and mutate cart state. Full embed & dev events unlock on the Runway Plan ($49.99/mo).
  • Complete the Look layers up to 3 garments (top + bottom + outerwear) from custom.pair_with metafields or the Shopify Product Recommendations API, then posts every SKU in a single cart mutation.
  • privacyZeroPhotoStorage is on by default: EXIF stripped client-side (maxDim 1400px), TLS 1.3 transport, volatile-RAM processing—built for GDPR, UAE PDPL, Saudi PDPL, and luxury shoppers.
ARCHITECTURE & CAPABILITY MATRIX

Style Swap AI vs. Legacy Theme-Only Try-On & Static Lookbooks for Headless

RequirementStyle Swap AI (`seed-try-on`)Legacy Theme-Only Try-On WidgetsStatic Lookbook / Manual Styling Baseline
Headless integration (Hydrogen, Next.js, Framer)✓ Signed App Proxy + typed DOM events; zero theme dependency✕ Locked to Online Store 2.0 theme blocks; breaks on headlessLookbooks must be rebuilt per framework and per campaign
Multi-garment outfit try-on (up to 3 pieces)✓ Layered inference driven by custom.pair_with metafields or Product Recommendations API✕ Single garment only; no cross-sell or bundle logicStatic shoots can't adapt to shopper-built combinations
Shopper privacy (zero photo storage)✓ Client-side EXIF stripping, TLS 1.3, volatile-RAM processing (default on)✕ Selfies often persisted in merchant databases—GDPR/PDPL exposureNo shopper photos, but zero personalization
Performance & CLS on headless pages✓ Fixed-position pill, reserved dimensions, lazy-loaded inference—zero CLS✕ Theme widgets frequently inject render-blocking scriptsNo runtime cost, but no interactive try-on either
Cart integration (Storefront Cart API)✓ seed-try-on:add-to-cart / complete-look-add payloads map to one multi-line cartLinesAdd✕ Manual cart form overrides; no multi-SKU bundleSingle-product adds only
Social story generation (9:16)✓ Client-side canvas compositor exports 1080x1920 cards for WhatsApp & Instagram via Web Share API✕ No story export; requires third-party design toolsCampaign imagery must be manually resized per placement
Lead capture & ROI attribution✓ Server-side Klaviyo 'Tried On Product' event + orders/paid webhook revenue attribution (Runway Plan and above)✕ Client-only workarounds; no closed-loop revenue attributionNo try-on data exists to attribute
01 • Architecture Overview

HMAC-Verified App Proxy & Zero-CLS Floating Pill

Style Swap AI exposes a signed App Proxy at /apps/try-on/* on your shop's domain. Every request is HMAC-SHA256-verified against your app proxy secret, so only your storefront can invoke the Seedream 5.0 Pro inference engine. On the client you ship only a lightweight launcher: a fixed-position floating pill with reserved dimensions (zero CLS) that lazy-loads the try-on module on first interaction—your LCP and INP budgets stay intact.

  • Hydrogen: render the pill from a client component in root.tsx. Next.js App Router: load the launcher via next/script with the afterInteractive strategy in app/layout.tsx and keep listeners inside 'use client' components.
  • Framer: paste the same snippet into a custom code block or fire seed-try-on:open from a code override—the proxy is domain-agnostic, so there is no per-framework build.
  • Pass productHandle, variantId, and optional pair_with context in the event detail to pre-stage a 3-piece outfit before the modal opens.
  • privacyZeroPhotoStorage is true by default: EXIF is stripped and the selfie compressed to maxDim 1400px in the browser before anything leaves the device.
// Hydrogen / Next.js client component: open the try-on modal
const handleTryOn = (productHandle, variantId) => {
  window.dispatchEvent(new CustomEvent('seed-try-on:open', {
    detail: { productHandle, variantId, mode: 'quick' }
  }));
};

// Framer: same event from a code override — the proxy is domain-agnostic
const openTryOn = () => {
  window.dispatchEvent(new CustomEvent('seed-try-on:open', {
    detail: { productHandle: '{{product.handle}}' }
  }));
};
02 • Embedding & Custom Events

React & Framer Integration with seed-try-on DOM Events

All communication between the try-on engine and your UI runs over three typed CustomEvents on window—seed-try-on:open, seed-try-on:add-to-cart, and seed-try-on:complete-look-add. Because the contract is event-based, it works identically in Hydrogen client components, Next.js 'use client' components, and Framer code overrides: no SDK, no prop drilling, no hydration mismatch. Listen for the two cart events to update state, fire analytics, and post the bundle.

  • Register listeners once in a useEffect with a cleanup function; seed-try-on:add-to-cart delivers variant ID and quantity payloads ready for your existing cart mutation.
  • seed-try-on:complete-look-add carries up to 3 variant IDs—map it to a single cartLinesAdd (Storefront Cart API) so the whole outfit lands in one checkout and one AOV data point.
  • Reposition or relabel the pill with data attributes; it is position: fixed with reserved dimensions, so tuning it never touches layout.
  • Full embed controls and dev events unlock on the Runway Plan ($49.99/mo); every plan starts with a 7-day free trial including up to 50 try-on credits.
// Any 'use client' component (Next.js) or Hydrogen client component
useEffect(() => {
  const onAddToCart = (e) => cartLinesAdd(e.detail); // { variantId, quantity }
  const onCompleteLook = (e) => cartLinesAdd({ lines: e.detail.items }); // up to 3 SKUs
  window.addEventListener('seed-try-on:add-to-cart', onAddToCart);
  window.addEventListener('seed-try-on:complete-look-add', onCompleteLook);
  return () => {
    window.removeEventListener('seed-try-on:add-to-cart', onAddToCart);
    window.removeEventListener('seed-try-on:complete-look-add', onCompleteLook);
  };
}, []);
03 • Complete the Look & Cart Bundling

Multi-Garment Outfit Try-On with Storefront Cart API Bundles

Complete the Look is the highest-leverage merchandising surface on a headless build. Style Swap AI reads custom.pair_with metafields (a JSON list of variant IDs) on each product, falls back to DOM cross-sell detection or the Shopify Product Recommendations API, and layers top + bottom + outerwear in a single inference pass. When the shopper accepts, seed-try-on:complete-look-add hands your cart mutation every SKU at once.

  • Merchandising: set custom.pair_with on hero SKUs to steer shoppers toward high-margin layers—blazer over slip dress, abaya over loungewear—and the AI renders exactly the combinations you curate.
  • Long-tail catalog? Skip metafields and let the Product Recommendations API fallback rank visually compatible pieces automatically.
  • Checkout: map the event payload to one cartLinesAdd mutation with multiple merchandise lines so the bundle posts a single checkout—no sequential adds, no dropped items.
  • Measure: segment the Klaviyo 'Tried On Product' event by look_type = complete_look to compare bundle AOV against single-garment try-ons.
Complete the Look in Action3 SKUs. 1 tap. 1 checkout.
Layer 3 garments with zero selfie storage BeforeBefore
Layer 3 garments with zero selfie storage AfterAI Try-On Result
Layer 3 garments with zero selfie storage
Layer 3 garments with zero selfie storage
Model 1 goes from base photo to a styled 3-piece outfit—top, bottom, and blazer—rendered in one multi-garment inference pass.
04 • Privacy & Performance

Zero-Photo Storage, 2K Inference & Klaviyo Attribution

Headless shoppers expect app-grade privacy and speed. privacyZeroPhotoStorage (on by default) compresses and strips EXIF in the browser (maxDim 1400px), transmits over TLS 1.3, and processes the selfie in volatile RAM only—nothing is written to disk, your database, or Shopify Admin. Quick Mode returns 1K previews in ~8–10 seconds; Studio Mode renders 2K high-definition output, with Priority 2K generation on the Unlimited Fashion Plan ($199.99/mo).

  • Compliance-ready for GDPR, UAE PDPL, and Saudi PDPL: no selfie is ever persisted or merchant-visible. Say so on the PDP—it converts privacy-sensitive and modest-fashion shoppers.
  • Protect Core Web Vitals: the launcher is a few KB and the inference module lazy-loads on the first seed-try-on:open, so LCP and INP are untouched until a shopper opts in.
  • Klaviyo sync (Runway Plan, $49.99/mo and above) fires a server-side 'Tried On Product' event—build abandoned-try-on flows and segment by look_type or atmosphere remix.
  • The orders/paid webhook attributes revenue and AOV to each try-on session, so you can reconcile ROI against your plan's included credits and overage rate ($0.10–$0.16 per try-on by tier).
// Server-side Klaviyo event fired by Style Swap AI (Runway Plan and above)
{
  "event": "Tried On Product",
  "customer_properties": { "$email": "shopper@example.com" },
  "properties": {
    "product_id": 123456789,
    "variant_id": 987654321,
    "look_type": "complete_look",
    "try_on_mode": "quick",
    "storefront": "hydrogen"
  }
}
FREQUENTLY ASKED QUESTIONS

Common Founder & Technical Questions: Hydrogen & Next.js Headless

How do I verify the HMAC signature on the App Proxy in a Hydrogen or Next.js storefront?

Shopify appends a signature query parameter to every proxied request. Recompute the HMAC-SHA256 of the sorted query string (excluding the signature) with your app proxy secret and compare using a constant-time check. Style Swap AI ships a Node.js reference implementation that drops into Hydrogen server utilities and Next.js route handlers.

Can I use Style Swap AI with Next.js App Router without any Shopify theme files?

Yes—nothing touches your theme. Add the launcher script to app/layout.tsx with the afterInteractive strategy, keep event listeners inside 'use client' components, and wire seed-try-on:add-to-cart to your existing cart mutation. The floating pill and all try-on logic load from the App Proxy.

Does the Complete the Look bundle work with Shopify's Storefront Cart API?

Yes. When a shopper accepts a 3-piece look, seed-try-on:complete-look-add fires with an array of variant IDs and quantities. Map it to a single cartLinesAdd (or cartCreate) mutation with multiple merchandise lines—one checkout, all three garments, one clean AOV data point.

How does PrivacyZeroPhotoStorage comply with GDPR and UAE PDPL?

The selfie is compressed and stripped of EXIF metadata client-side (max dimension 1400px), sent over TLS 1.3, and processed in volatile RAM only. It is never written to disk, a merchant database, or Shopify Admin, and the memory is wiped after the response—satisfying GDPR, UAE PDPL, and Saudi PDPL requirements out of the box.

What is the try-on latency on headless, and does it hurt CLS?

Quick Mode returns a 1K image in ~8–10 seconds; Studio Mode renders 2K high-definition output with priority generation on the Unlimited Fashion Plan ($199.99/mo). The pill is position: fixed with reserved dimensions—zero cumulative layout shift—and the AI bundle lazy-loads only when a shopper starts a try-on.

Which plan do I need for headless embeds, dev events, and Klaviyo?

All plans include a 7-day free trial with up to 50 try-on credits. Trend ($19.99/mo, 100 try-ons/mo, $0.16 per overage try-on) covers core try-on; Runway ($49.99/mo, 350 try-ons/mo, $0.14 overage) unlocks full embed & dev events plus Klaviyo sync—the headless sweet spot; Unlimited Fashion ($199.99/mo, 2,000 try-ons/mo, $0.10 overage) adds Priority 2K generation, unlimited shares, and a dedicated CSM.

EXPLORE ALL 20 ARCHITECTURE & MERCHANDISING PLAYBOOKS
UAE & Modest Fashion →
Privacy-First AI Virtual Try-On for UAE, Dubai & GCC Modest Fashion Brands (Abayas, Kaftans & Loungewear)
Complete-the-Look Builder →
AI Complete-the-Look Outfit Builder for Shopify: Multi-Garment Virtual Try-On
Framer + Shopify Headless →
Virtual Try-On for Framer + Shopify Headless Storefronts
Reduce Returns & ROI Calculator →
How to Reduce Shopify Apparel Return Rates & Boost AOV with an AI Fitting Room
Saudi Arabia (KSA) Abaya & Kaftan →
Riyadh, Jeddah & Khobar Abaya Playbook: Zero-Photo AI Try-On, Arabic RTL, WhatsApp Story Cards
Qatar & Kuwait Luxury Modest →
AI Try-On for Qatar & Kuwait Luxury Modest: Private VIP Styling at 2K
Bridal & Eveningwear Dresses →
Bridal & Eveningwear Dresses: Cut Bracket Orders with AI Complete-the-Look Try-On
Menswear Tailoring & Suiting →
Menswear Tailoring & Suiting: AI Try-On for Lapel Roll, Shoulder Structure & 3-Piece Styling
Co-Ord Sets & Loungewear →
Co-Ord Sets & Loungewear: Lift Attach Rates with 1-Click, 3-Piece Complete-the-Look AI Try-On
Streetwear & Limited Drops →
Drop-Ready Streetwear Try-On: Hype, Hoodies, and 9:16 UGC Story Cards
Denim & Trousers Visualization →
Visualize High-Rise vs Mid-Rise Denim Fits & Hem Break in Seconds—Zero Selfie Required
Resortwear & Linen Brands →
Resortwear & Linen: Sell Sunlit Separates and Kaftans Year-Round with AI Try-On
Outerwear & Trench Layering →
Outerwear & Trench Layering: Solving Open-Coat Diffusion Erasure for High-AOV Shopify Brands
Activewear & Studio Athleisure →
Activewear 3-Piece Try-On: Bundle Sports Tops, Leggings & Zip-Through Jackets Privately
Sustainable & Slow Fashion ROI →
Cut Returns, Carbon & Deadstock Risk: AI Try-On for Ethical Fashion
Klaviyo Fitting Room Flows →
Klaviyo Abandoned Fitting Room Flows: Convert High-Intent Try-Ons Into Revenue
WhatsApp & IG Story Viral Loops →
Engineering Zero-CAC WhatsApp & Instagram Story Viral Loops with Style Swap AI's 9:16 Compositor
Shopify Plus Markets & RTL →
Deploying Localized AI Fitting Rooms Across Shopify Markets with Automatic RTL & Privacy Compliance
Hydrogen & Next.js Headless →
Headless Try-On Architecture: Hydrogen, Next.js & Framer with Style Swap AI
Zero-Selfie Studio Model Mode →
Zero-Selfie Studio Model Fitting Room: Convert Dark-Room TikTok Traffic with Modest AI Try-On
Competitor Comparisons & Buyer’s Guides (20):Best Shopify Virtual Try-On Apps (2026)Style Swap AI vs. GenLookStyle Swap AI vs. Lookify & LooxiAI Fitting Room vs. Size Chart AppsStyle Swap vs. VeesualStyle Swap vs. Vue.aiStyle Swap vs. FASHN AIStyle Swap vs. Fit AnalyticsStyle Swap vs. CamwearaStyle Swap vs. Try-On.AIZeekit-Grade Try-On for ShopifyDressX AR vs. Generative AI Try-OnSeedream 5.0 vs. Kolors & Kling3D Cloth Sim vs. Generative AIAI Model Swap vs. Shopper Try-OnBest Modest Fashion Try-On AppsBest Complete-the-Look AppsVirtual Try-On vs. Fit QuizzesShopify Plus Enterprise Try-OnPrivacy-First GDPR & GCC Try-On