# @algolia/react-recommendations

> This is the repository packaging the Algolia Recommend React component as well as an Algolia Recommend demo.

Latest version **1.0.0-beta.9** (published 2021-04-28) · 0 weekly downloads

## Install

```sh
npm install @algolia/react-recommendations
pnpm add @algolia/react-recommendations
yarn add @algolia/react-recommendations
bun add @algolia/react-recommendations
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0-beta.9 |
| Published | 2021-04-28 |
| First published | 2021-04-27 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | tomklotz, praagyajoshi, shortcuts, plnech, rasemotte, thomaslef, lukyvj, sepehrf, kosai106, marielaure, redox, mthuret, haroenv, rayrutjes, speedblue, jerska, raphi, cbaptiste, ronanlevesque, samouss, therealwebby, francoischalifour, jonmontane, mikaa123, valentindotxyz, shipow, tkrugg, seafoox, sylvainh, clemfromspace, lorrissaintgenez, broujo, marieglr, e-krebs, eunjae-lee, kombucha, h1fra, sylvain, crawler-team, amcdaid106, devinalgolia, dispix, jvenezia, otomatik, julienbourdeau, sophiem03, mschreiber, sarahdayan, alexandremeunier, dcoates, maximehuang, netgusto, guitek, matthewbond, cyril.descossy, tatsuro, adrian.tofan, danajeremy, mathougui, xavdh, agdavid, charbell |

## Links

- npm: https://www.npmjs.com/package/@algolia/react-recommendations
- npm.io page: https://npm.io/package/@algolia/react-recommendations

## Dependencies (1)

- [react-instantsearch-dom](https://npm.io/package/react-instantsearch-dom.md) ^6

## Recent versions

- 1.0.0-beta.9 (latest) — 2021-04-28
- 1.0.0-experimental.2 (experimental) — 2021-05-25
- 1.0.0-experimental.1 — 2021-05-21
- 1.0.0-experimental.0 — 2021-05-19
- 1.0.0-beta.8 — 2021-04-28
- 1.0.0-beta.7 — 2021-04-28
- 1.0.0-beta.6 — 2021-04-28
- 1.0.0-beta.5 — 2021-04-27
- 1.0.0-beta.4 — 2021-04-27
- 1.0.0-beta.3 — 2021-04-27
- 1.0.0-beta.2 — 2021-04-27
- 1.0.0-beta.1 — 2021-04-27

## README

# @algolia/react-recommendations

This is the repository packaging the Algolia Recommend React component as well as an Algolia Recommend demo.

**During the beta of Algolia Recommend, this React component relies on an Algolia Index to retrieve the recommendations, and performs a regular Search API request to get the recommendations.**

## Install

```sh
npm install --save @algolia/react-recommendations@1.0.0-beta.9
```

## Usage

```js
import { Recommendations } from "@algolia/react-recommendations";
```

### Props

Available props:

- `searchClient`: the Algolia API Client to use
- `model`: the name of the Recommendation model to use (`bought-together` or `related-product`)
- `indexName`: the name of the products index
- `objectID`: the objectID of the product to get recommendations from
- `hitComponent`: the InstantSearch-compatible `Hit` widget
- (optional) `maxRecommendations`: the number of recommendations to retrieve (default: max recommendations available)
- (optional) `facetFilters`: additional facet filters
- (optional) `fallbackFilters`: additional filters to use as fallback should there not be enough recommendations
- (optional) `analytics`: whether you want Search Analytics to be turned on or not (default: `false`)
- (optional) `clickAnalytics`: whether you want Click Analytics to be turned on or not (default: `false`)

```jsx
<Recommendations
  searchClient={searchClient}
  model={"related-products" | "bought-together"}
  indexName={"your_source_index_name"}
  objectID={currentObjectID}
  hitComponent={Hit}
  maxRecommendations={5}
  facetFilters={[]}
  fallbackFilters={[]}
  analytics={true | false}
  clickAnalytics={true | false}
/>
```

## Development

To run this project locally, install the dependencies and run the local server:

```sh
yarn
yarn start
```

Open http://localhost:3000 to see your app.

---
_Source: https://npm.io/package/@algolia/react-recommendations · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
