{ data, error } controllers, except searchFeedback() and trackingEvent() which return a single direct { data, error } result. Controllers expose get(), subscribe(), and dispose().
SDK instance creation
collection
Browse products in a collection.get() call accepts a shallow merge of the initial params, so you can change pagination, sort, or filters after the controller is created:
sdk.collection():
search
Execute a full-text search. The search query is fixed when the controller is created. You can then update pagination, filters, and sort withget().
search controller automatically prepares the query before execution and retries when the API returns a 425 (not prepared yet).
searchContent
Search for non-product content such as articles.autocomplete
Fetch search suggestions as the shopper types. Unlikesearch, get() accepts a new query each call.
suggest (deprecated)
suggest() is a debounced wrapper around autocomplete(). It is retained for v2 compatibility but is deprecated. New code should use autocomplete() with createDebounce() or your framework’s debouncing utility.
imageSearch
Search for products using an image ID returned byuploadImage().
imageData (a base64 string or Blob) and the SDK will upload it automatically for each get() call.
uploadImage
Upload an image for visual search. The controller is uncached; eachget() call uploads the image again.
similarProducts
Fetch products similar to a given product.blocks
Fetch product recommendations from a Layers block.blockId instead of anchorId.
facets
Fetch facet counts for a collection at runtime. This replaces thefacets array that was configured at SDK init in v2.
sortOrders
Fetch available sort orders at runtime.searchFeedback
Send feedback about search results. This is a direct, non-controller call.trackingEvent
Send a custom analytics event. This is a direct, non-controller call.Subscribing to controller state
Usesubscribe or the controller’s subscribe method to react to state changes.
Disposing controllers
Calldispose() when a controller is no longer needed to stop subscriptions, abort in-flight requests, and clean up cached references:
Deprecated v2 methods
See Upgrade to v3 for a complete migration guide.