Prerequisites — before implementing Anti-Bracketing, complete the Cookie consent and Installation steps on the JS Library page. Kleep must not load until the visitor has consented via your CMP, and the library must be loaded site-wide.
Anti-Bracketing is available on demand. If you’re unsure whether this feature is enabled for your account, contact your Kleep representative.
What Anti-Bracketing does
When a shopper adds two or more sizes of the same product to their cart, Anti-Bracketing opens a prompt asking them to commit to one size. It can optionally display Kleep’s AI size recommendation to help them choose confidently. The prompt appears as a side panel (sliding in from the right) or a modal (centered overlay), depending on your configuration. Shoppers can always dismiss it and keep all sizes.How to implement
Step 1: Wait for the SDK Thekleep.antiBracketing method is available once the widget script has loaded. Wait for it before initializing:
getCart, detect bracketing, and show the prompt when appropriate.
Step 4: Notify on cart changes
Call notifyCartChanged() whenever the cart is updated (add to cart, remove, quantity change) so the widget re-checks:
setLineQuantity in the adapter, the SDK removes the unkept lines automatically (applied will be true). Otherwise, handle removal in the resolve callback.
Step 6: Cleanup
Full example
Configuration
All visual settings — trigger frequency, layout, wordings, content toggles — are managed from the Kleep dashboard at AI Sizing → Anti-bracketing. The widget reads them from the Kleep CDN at runtime, so you do not need to pass them in code. You can override specific settings at initialization time if needed:Reference
Initialization parameters
Adapter contract
The adapter tells the widget how to read and modify your cart.Instance methods
Events
Style options
Visual overrides passed viaconfig.style:
