1.14.0 • Published 3 months ago
@algolia/recommend-react v1.14.0
@algolia/recommend-react
React package for Algolia Recommend.
Installation
All Recommend packages are available on the npm registry.
yarn add @algolia/recommend-react
# or
npm install @algolia/recommend-react
Usage
Import the FrequentlyBoughtTogether
and RelatedProducts
and use them in your parent component.
import React from 'react';
import {
FrequentlyBoughtTogether,
RelatedProducts,
} from '@algolia/recommend-react';
import recommend from '@algolia/recommend';
const recommendClient = recommend('YourApplicationID', 'YourSearchOnlyAPIKey');
const indexName = 'YOUR_INDEX_NAME';
function App({ currentObjectID }) {
// ...
return (
<div>
<FrequentlyBoughtTogether
recommendClient={recommendClient}
indexName={indexName}
objectIDs={[currentObjectID]}
itemComponent={({ item }) => {
return (
<pre>
<code>{JSON.stringify(item)}</code>
</pre>
);
}}
/>
<RelatedProducts
recommendClient={recommendClient}
indexName={indexName}
objectIDs={[currentObjectID]}
itemComponent={({ item }) => {
return (
<pre>
<code>{JSON.stringify(item)}</code>
</pre>
);
}}
/>
</div>
);
}
Continue reading our Getting Started guide.
Documentation
The documentation offers a few ways to learn about the Recommend library:
- Follow the Building your Recommend UI guide to display recommendations on your website.
- Refer to the API reference for a comprehensive list of parameters and options.
1.14.0
3 months ago
1.13.0
3 months ago
1.12.1
4 months ago
1.12.0
4 months ago
1.11.0
5 months ago
1.9.0
10 months ago
1.10.0
8 months ago
1.8.2
11 months ago
1.8.1
1 year ago
1.8.0
1 year ago
1.7.1
2 years ago
1.7.0
2 years ago
1.6.0
2 years ago
1.5.0
2 years ago
1.4.0
2 years ago
1.3.1
2 years ago
1.2.0
2 years ago
1.3.0
2 years ago
1.1.0
3 years ago
1.0.0
3 years ago
1.0.0-experimental.6
3 years ago
1.0.0-experimental.5
3 years ago
1.0.0-experimental.4
3 years ago
1.0.0-experimental.3
3 years ago