state— aReadonlySignal<QueryState<T>>with{ data, error, isFetching }execute()— runs the query, returnsResult<T, ClientError>subscribe(callback)— reacts to state changes without importing signalsdispose()— cleans up subscriptions and aborts pending requests
client.collection() - Browse collections
Browse products in a collection with filters, sort, and pagination.
Execute parameters:
client.blocks() - Product recommendations
Product recommendations powered by Layers blocks. Anchored to a product, collection, or cart.
Execute parameters:
DiscountEntitlement:
productsInCart, geo, customer, and custom.
client.search() - Product search
Product search with facets. Options persist across calls, so subsequent execute() calls merge with existing options.
client.suggest() - Predictive search
Predictive search with debouncing and local caching. Only full words (trailing space) are cached. Partial input filters cached results client-side.
client.uploadImage() - Upload image
Upload an image for image-based search.
client.searchByImage() - Search by image
Search products using an uploaded image.
client.searchContent() - Search articles and blog content
Search articles and blog content with pagination. Options persist across calls, so subsequent execute() calls merge with existing options.
Response:
createProductCard() - Product card controller
Reactive controller for product cards with variant selection and availability logic. All derived values are computed signals that auto-update when inputs change. This is a standalone function, not a client method.
Reactive state (all
ReadonlySignal):
Actions:
ProductCardState (passed to subscribe callback):
OptionValue.status is computed from inventory and availability data across all variants that match the current selection.
Abort signals
Controllers support two levels of abort:execute() starts.