listAvailableAlgorithms( )
Returns a list of recommendation algorithms that can be used on your Wix site or project. These algorithms can be used with getRecommendation()
to provide item recommendations to the customer.
Description
Algorithms are run by the apps that provide them, and can only be used on catalogs they support. Apps may provide algorithms for use with their own catalogs and/or catalogs from other apps.
The app which provides an algorithm is referenced by that algorithm’s appId
. The apps whose catalogs are supported by an algorithm are referenced by the IDs in that algorithm’s catalogAppIds
array.
For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:
- The algorithm’s
appId
must match the ID of an installed Wix app. - At least 1 of the IDs in
catalogAppIds
must match the ID of an installed Wix app.
Wix app IDs are listed here.
Syntax
function listAvailableAlgorithms(): Promise<ListAvailableAlgorithmsResponse>
listAvailableAlgorithms Parameters
This function does not take any parameters.
Returns
Return Type:
NAME
TYPE
DESCRIPTION
Algorithms available for use on your Wix site or project. See the method description for more information.
Was this helpful?
listAvailableAlgorithms example
1import { recommendations } from 'wix-ecom-backend';23 async function listAvailableAlgorithms() {4 try {5 const result = await recommendations.listAvailableAlgorithms();67 return result;8 } catch (error) {9 console.error(error);10 // Handle the error11 }12 }13