Skip to main content
Import the DepictSearchProvider component from the installed package and create an instance of DepictSearchProvider:

Optional configuration

Beyond merchant, market, searchPagePath, and locale, the constructor accepts the following options:

Customising price formatting

Price formatting is part of the locale object. It applies to the price filter, result counts, and prices in the search modal; prices inside your own productCard are formatted by you. The type and its defaults:
To customise it, spread the imported locale and override price_formatting_:

Fetching search results without the UI

To use Depict search results in your own UI — for example a custom autocomplete — call fetchSearchResults on the provider instead of rendering the SDK’s components:
The returned displays have your displayTransformers applied, so they include page_url.

Limits and behavior

  • You can’t create more than one DepictSearchProvider on the same page unless you give each one a unique uniqueInstanceKeyForState (for example "1", "2", …), because instance state lives in the URL and history.state and would otherwise collide.
Review the types or the reference to see what you can configure on the DepictSearchProvider.
If you’re seeing a type error after providing YourDisplay, don’t fret and go to the next step