window.bitstudio. Define the queue before loading the script so early commands replay in order.
The
bitstudio identifier remains unchanged for backward compatibility. It is the supported browser API for virtual.fit custom integrations.init
Initialize one storefront configuration.
siteKey is required. Calling init starts product matching and keeps it current as the page URL changes. See Loader configuration for all fields.
setContext
Patch multiple parts of the active configuration.
setContext when a single application state update changes both product and customer context.
setProduct
Set or replace the current product context.
id or handle. The value must resolve to a synced, enabled product with usable garment images.
Call this after an SPA commits a product route when URL detection cannot identify the product. Call it again after every product or variant transition.
For color or style variants, id must identify the selected variant’s synced virtual.fit product. Changing only imageUrl changes display context; it does not change the prepared garment used for try-on.
setCustomer
Update shopper identity after login, logout, or account switching.
setConsentMode
Choose whether analytics may include shopper identity.
| Value | Behavior |
|---|---|
consented | Analytics may include the resolved shopper identity. |
cookieless | Analytics omits shopper identity and uses cookieless measurement. |
track
Send a normalized commerce event.
track after storefront analytics has initialized. Events sent before analytics is ready are not queued and may be dropped with a console warning.
See the commerce event reference →
Object-style alias
The loader also exposeswindow.BitStudio:
init, setContext, setProduct, setCustomer, setConsentMode, and track. Prefer the queued bitstudio(...) form in integration snippets because it works before the async loader finishes.