Files
medusa-store/packages/medusa-plugin-algolia
Shahed Nasser 95232e7ac9 chore: updated READMEs of plugins (#3546)
* chore: updated READMEs of plugins

* added notice to plugins
2023-03-23 09:43:17 +02:00
..
2023-02-14 17:30:40 +01:00
2023-02-14 17:30:40 +01:00

Algolia

Provide powerful indexing and searching features in your commerce application with Algolia.

Algolia Plugin Documentation | Medusa Website | Medusa Repository

Features

  • Flexible configurations for specifying searchable and retrievable attributes.
  • Ready-integration with Medusa's Next.js starter storefront.
  • Utilize Algolia's powerful search functionalities including typo-tolerance, query suggestions, results ranking, and more.

Prerequisites


How to Install

1. Run the following command in the directory of the Medusa backend:

npm install medusa-plugin-algolia

2. Set the following environment variables in .env:

ALGOLIA_APP_ID=<YOUR_APP_ID>
ALGOLIA_ADMIN_API_KEY=<YOUR_ADMIN_API_KEY>

3. In medusa-config.js add the following at the end of the plugins array:

const plugins = [
  // ...
  {
    resolve: `medusa-plugin-algolia`,
    options: {
      application_id: process.env.ALGOLIA_APP_ID,
      admin_api_key: process.env.ALGOLIA_ADMIN_API_KEY,
      settings: {
        products: {
          searchableAttributes: ["title", "description"],
          attributesToRetrieve: [
            "id",
            "title",
            "description",
            "handle",
            "thumbnail",
            "variants",
            "variant_sku",
            "options",
            "collection_title",
            "collection_handle",
            "images",
          ],
        },
      },
    },
  },
]

Test the Plugin

1. Run the following command in the directory of the Medusa backend to run the backend:

npm run start

2. Try searching products either using your storefront or using the Store APIs.


Additional Resources