How ramyyyy-00/tryon-widget works
This MVP embeds a virtual try-on button in clothing product pages, obtains a short-lived Decart token through its backend, and streams camera video and a garment image into Decart’s realtime model. The widget also handles consent, localized UI, session timing, and cleanup; the server restricts brands and origins, enforces limits, and records monthly usage. The demo is an initiating storefront. Source excerpts show the runtime flow; README documents brand setup and deployment context, while no separate admin, billing, Shopify, or WordPress implementation exists.
Main entry points: tryon-widget.js Realtime session and timer · server.js Token API and static hosting · index.html Demo storefront · brands.json Brand origins and limits
Components 10
Storefront widget
- Embed and product buttons
public/tryon-widget.js - Consent and camera UI
public/tryon-widget.js - Garment and prompt setup
public/tryon-widget.js - Realtime session and timer
public/tryon-widget.js
Token and usage backend
- Token API and static hosting
server.js - Brand origins and limits
brands.json - Monthly usage counter
server.js
Try-on provider
- Decart token and realtime service
Other components
- Store shopper
- Demo storefront
demo/index.html
Connections 12
- Store shopper → Demo storefront: opens demo
README.md - Store shopper → Embed and product buttons: clicks try-on
public/tryon-widget.js - Demo storefront → Embed and product buttons: loads widget
README.md - Embed and product buttons → Consent and camera UI: opens consent
public/tryon-widget.js - Consent and camera UI → Realtime session and timer: starts session
public/tryon-widget.js - Realtime session and timer → Token API and static hosting: requests token
public/tryon-widget.js - Token API and static hosting → Brand origins and limits: checks brand
server.js - Token API and static hosting → Monthly usage counter: checks and counts
server.js - Token API and static hosting → Decart token and realtime service: creates token
server.js - Realtime session and timer → Decart token and realtime service: connects realtime
public/tryon-widget.js - Realtime session and timer → Garment and prompt setup: loads garment
public/tryon-widget.js - Garment and prompt setup → Realtime session and timer: sets prompt and image
public/tryon-widget.js