JavaScript API Client
Fetching recommendations
The fetchDepictRecommendations
function takes an object of options as its argument, and returns a promise of an array of so-called displays (product data). Reference.
Regarding MERCHANT_ID and MARKET, see the comments here
For a list of possible types, try checking the preview browser or ask your Depict contact. Usually the available types are also detailed in the kickoff slides. If you get
{"error":"(tenant, market, type) not yet configured. Please contact Depict."}
that probably means a type isn’t available for you - let us know if you want it.Fetching general recommendations:
General recommendations are recommendations that aren’t related to any particular content but specific to the type of page. Most often, these are recommendations for the front page.
TypeScript
Fetching recommendations for one specific product
Use this if you want to fetch recommendations for a specific product. For example, if you want to show recommendations below the description on a product page.
TypeScript
Fetching recommendations for multiple products
Use this if you want to fetch recommendations for multiple products, e.g., for everything a user has in their cart.
TypeScript
Got more questions? See the reference
Was this page helpful?