You're viewing an archived version of our docs. Check out our current documentation →

Retrieve a rule

Retrieves a Recommend rule that you previously created in the Algolia dashboard.

Usage

Required ACL: settings
1
2
3
4
5
6
7
8
9
import { algoliasearch } from 'algoliasearch';

const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY').initRecommend();

const response = await client.getRecommendRule({
  indexName: 'indexName',
  model: 'related-products',
  objectID: 'objectID',
});