Search.../

listAvailableAlgorithms( )

Developer Preview

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:

  1. The algorithm’s appId must match the ID of an installed Wix app.
  2. 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:

Promise<
ListAvailableAlgorithmsResponse
>
NAME
TYPE
DESCRIPTION
availableAlgorithms
Array<
AlgorithmInfo
>

Algorithms available for use on your Wix site or project. See the method description for more information.

Was this helpful?

listAvailableAlgorithms example

Copy Code
1import { recommendations } from 'wix-ecom-backend';
2
3 async function listAvailableAlgorithms() {
4 try {
5 const result = await recommendations.listAvailableAlgorithms();
6
7 return result;
8 } catch (error) {
9 console.error(error);
10 // Handle the error
11 }
12 }
13