JSPM

@algolia/recommend

4.12.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1460454
  • Score
    100M100P100Q243087F
  • License MIT

The perfect starting point to integrate Algolia Recommend within your JavaScript project.

Package Exports

  • @algolia/recommend
  • @algolia/recommend/dist/recommend.umd.js
  • @algolia/recommend/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@algolia/recommend) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Algolia Recommend

The perfect starting point to integrate Algolia Recommend within your JavaScript project

NPM version License

DocumentationUI libraryCommunity ForumStack OverflowReport a bugSupport

✨ Features

  • Thin & minimal low-level HTTP client to interact with Algolia's Recommend API
  • Works both on the browser and node.js
  • UMD compatible, you can use it with any module loader
  • Built with TypeScript

💡 Getting Started

First, install Algolia Recommend API Client via the npm package manager:

npm install @algolia/recommend

Then, let's retrieve recommendations:

const algoliarecommend = require('@algolia/recommend');

const client = algoliarecommend('YourApplicationID', 'YourAdminAPIKey');

client
  .getFrequentlyBoughtTogether([
    {
      indexName: 'your_index_name',
      objectID: 'your_object_id',
    },
  ])
  .then(({ results }) => {
    console.log(results);
  })
  .catch(err => {
    console.log(err);
  });

client
  .getRelatedProducts([
    {
      indexName: 'your_index_name',
      objectID: 'your_object_id',
    },
  ])
  .then(({ results }) => {
    console.log(results);
  })
  .catch(err => {
    console.log(err);
  });

For full documentation, visit the online documentation.

📄 License

Algolia Recommend API Client is an open-sourced software licensed under the MIT license.