Skip to main content
All methods return { 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.
The get() call accepts a shallow merge of the initial params, so you can change pagination, sort, or filters after the controller is created:
Full params for sdk.collection(): Execute a full-text search. The search query is fixed when the controller is created. You can then update pagination, filters, and sort with get().
The 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. Unlike search, 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 by uploadImage().
You can also pass 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; each get() call uploads the image again.

similarProducts

Fetch products similar to a given product.

blocks

Fetch product recommendations from a Layers block.
You can also fetch by blockId instead of anchorId.

facets

Fetch facet counts for a collection at runtime. This replaces the facets 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

Use subscribe or the controller’s subscribe method to react to state changes.

Disposing controllers

Call dispose() 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.