Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Haroenv committed May 17, 2024
1 parent 0a34d81 commit dd53b87
Showing 1 changed file with 26 additions and 7 deletions.
33 changes: 26 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
> 🙌 From now on you can use Algolia Recommend from withing InstantSearch, simplifying your integration between the two libraries!
> 🙌 From now on you can use Algolia Recommend from InstantSearch, simplifying your integration between the two libraries!
>
> Learn how to migrate following the [upgrade guide](https://www.algolia.com/doc/guides/algolia-recommend/upgrade-guides) provided.
> Learn how to migrate following the [upgrade guide](https://www.algolia.com/doc/guides/algolia-recommend/upgrade-guide).

```js
import instantsearch, {
frequentlyBoughtTogether,
relatedProducts,
} from 'instantsearch.js';
import algoliasearch from 'algoliasearch/lite';
const searchClient = algoliasearch('YourApplicationID', 'YourSearchOnlyAPIKey');

instantsearch({
// No need for a recommendClient anymore
searchClient,
Expand All @@ -17,14 +24,26 @@ instantsearch({
container: '#relatedProducts',
objectIDs: [currentObjectID],
}),
])
]);
```

```jsx
<InstantSearch searchClient={searchClient} indexName={indexName}>
<FrequentlyBoughtTogether objectIDs={[currentObjectID]} />
<RelatedProducts objectIDs={[currentObjectID]} />
</InstantSearch>
import {
InstantSearch,
FrequentlyBoughtTogether,
RelatedProducts,
} from 'react-instantsearch';
import algoliasearch from 'algoliasearch/lite';
const searchClient = algoliasearch('YourApplicationID', 'YourSearchOnlyAPIKey');

function App() {
return (
<InstantSearch searchClient={searchClient} indexName={indexName}>
<FrequentlyBoughtTogether objectIDs={[currentObjectID]} />
<RelatedProducts objectIDs={[currentObjectID]} />
</InstantSearch>
);
}
```

---
Expand Down

0 comments on commit dd53b87

Please sign in to comment.