Manual Control

Findify's Merchant.JS (MJS) library exposes a simple API that you can use to manage widgets, listen for and trigger different events, or utilize external analytics - thus further customizing the look and feel of the Findify integration. The MJS iterates over window.findifyCallbacks array and injects the findify object there. You can also access window.findify when MJS is fully loaded.


To wait until Findify is loaded push your callbacks into window.findifyCallbacks array.

window.findifyCallbacks = [
  (findify) => { ...your code here }
findify.analyticsThe @findify/analytics instance. It allows for the triggering of events from outside components and listens for them.
findify.configThe immutable configuration of your store. Use findify.config.toJS() to see it as a normal Javascript object.
findify.emitEmit system events, such as 'show mobile facets'.
findify.listenListen for system events.
findify.invalidateInvalidates modules cache[only for Devtools].
findify.widgetsThe collection of methods to create/modify already injected widgets. Read more below.

Manage Widgets

Attach new widget

window.findify.widgets.attach(selector, type, config)

selectorCSS selector or DOM node where you attach the widget.
typeThe type of widget - autocomplete, recommendation, search, smart-collection.
configThe configuration which will extend the default configuration for this type of widget eq:{ appendTo: 'body', key: 'test' }.

Remove Existing Widget

The key is the unique name of the widget. You can provide it in HTML element by adding data-findify-key="test" or in config when attaching feature.

Get Widgets by Key

You can get a widget by its key. If it was not provided, the increment number will be used.

Find Widgets by Type

Find all widgets with given type.

Get List of Widgets

This function will return an array of widgets on the page, so you can access their agents and send a request.

  .find(widget => widget.type === 'autocomplete').agent
  .set('q', 'test query')
  .on('suggestions', (list) => {