Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc(readme): announce InstantSearch compatibility #184

Merged
merged 4 commits into from
May 21, 2024

Conversation

Haroenv
Copy link
Contributor

@Haroenv Haroenv commented May 16, 2024

馃檶 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 for JS or for React.

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

instantsearch({
  // No need for a recommendClient anymore
  searchClient,
  indexName,
}).addWidgets([
  frequentlyBoughtTogether({
    container: '#frequentlyBoughtTogether',
    objectIDs: [currentObjectID],
  }),
  relatedProducts({
    container: '#relatedProducts',
    objectIDs: [currentObjectID],
  }),
]);
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>
  );
}

FX-2846

README.md Outdated Show resolved Hide resolved
Copy link

github-actions bot commented May 16, 2024

PR Preview Action v1.4.7
Preview removed because the pull request was closed.
2024-05-21 11:25 UTC

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@Haroenv Haroenv requested a review from sarahdayan May 17, 2024 13:05
README.md Outdated Show resolved Hide resolved
@Haroenv Haroenv requested a review from sarahdayan May 21, 2024 09:30
@Haroenv Haroenv marked this pull request as ready for review May 21, 2024 09:33
@Haroenv Haroenv merged commit d2b3bb3 into next May 21, 2024
7 checks passed
@Haroenv Haroenv deleted the doc/mention-instantsearch branch May 21, 2024 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants