@algolia/react-recommendations

1.0.0-beta.9 • Public • Published

@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

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

Usage

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)
<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:

yarn
yarn start

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

Readme

Keywords

none

Package Sidebar

Install

npm i @algolia/react-recommendations

Weekly Downloads

11

Version

1.0.0-beta.9

License

none

Unpacked Size

11.5 kB

Total Files

4

Last publish

Collaborators

  • wwalser
  • jkaho
  • mprevell97
  • louishousiaux
  • antoine.gilles
  • eventexperiences_algolia
  • jsok_algolia
  • bhinchley-algolia
  • hugowit
  • alg-admin
  • aymeric.giraudet
  • gavinwade12
  • bhcastle
  • rishi_algolia
  • jasonberry
  • scyganek-algolia
  • drodriguln
  • abodelot
  • leviwhalen
  • sfaiqh
  • valentindotxyz
  • fluf
  • instantsearch-bot
  • taylorcjohnson_algolia
  • pjankowski5312
  • raed-algolia
  • dylantientcheu
  • catalgolia
  • morgan-algolia
  • algabet
  • andy_ds
  • bengreenbank
  • alg-bgastinne
  • daltondickalgolia
  • jcohonner-algolia
  • robertmogos
  • mariaalungu
  • emmanuel.fortin
  • ejaldorau
  • dhaya.b
  • lukyvj
  • marielaure
  • haroenv
  • rayrutjes
  • jerska
  • ronanlevesque
  • samouss
  • therealwebby
  • francoischalifour
  • jonmontane
  • tkrugg
  • seafoox
  • sylvainh
  • clemfromspace
  • lorrissaintgenez
  • broujo
  • e-krebs
  • kombucha
  • sylvain
  • crawler-team
  • amcdaid106
  • devinalgolia
  • jvenezia
  • otomatik
  • sophiem03
  • sarahdayan
  • dcoates
  • maximehuang
  • guitek
  • matthewbond
  • cyril.descossy
  • tatsuro
  • danajeremy
  • mathougui
  • xavdh
  • agdavid
  • rasemotte
  • plnech
  • shortcuts
  • praagyajoshi
  • loicsay
  • svensoldin
  • alphonseb
  • leodau
  • fabienmotte
  • sarahfranc
  • millotp