New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

medusa-plugin-algolia

Package Overview
Dependencies
Maintainers
0
Versions
520
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

medusa-plugin-algolia

Algolia search plugin for Medusa

  • 0.2.21
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
869
decreased by-24.37%
Maintainers
0
Weekly downloads
 
Created
Source

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: {
    applicationId: process.env.ALGOLIA_APP_ID,
    adminApiKey: process.env.ALGOLIA_ADMIN_API_KEY,
    settings: {
      products: {
        indexSettings: {
          searchableAttributes: ["title", "description"],
          attributesToRetrieve: [
            "id",
            "title",
            "description",
            "handle",
            "thumbnail",
            "variants",
            "variant_sku",
            "options",
            "collection_title",
            "collection_handle",
            "images",
          ],
        },
        transformer: (product) => ({ 
          id: product.id, 
          // other attributes...
        }),
      },
    },
  },
},
]

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

Keywords

FAQs

Package last updated on 18 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc