npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@particular./import-moltin-to-algolia

v1.1.8

Published

Please contact Particular. via [email protected] for any questions

Downloads

22

Readme

@particular./import-moltin-to-algolia

npm version semantic-release code style: prettier CircleCI

Import Moltin data to Algolia

This example demonstrates how you can import products, brands, categories, collections, orders and/or customers to Algolia from Moltin through a Command Line Interface (CLI).

How to use locally

When running this example locally you'll want to be careful not to exceed you Algolia limits for catalog size.

1. Download the example

Clone the repository:

git clone [email protected]:uniquelyparticular/import-moltin-to-algolia.git

Install dependencies with Yarn (or NPM)

cd import-moltin-to-algolia
yarn

2. Configure Algolia

In this example we will import data to Algolia. You will need an account an account to continue.

Once you've signed up to Algolia, create a new app and give it a name.

Next head to the API keys section and make a note of your Application ID and Admin API Key, we will need these next.

3. Configure your ENV variables

You will want to create an .env inside the directory /import-moltin-to-algolia containing all the keys for the below:

MOLTIN_CLIENT_ID=
MOLTIN_CLIENT_SECRET=
MOLTIN_AGOLIA_INDICES=
ALGOLIA_APP_ID=
ALGOLIA_API_KEY=

MOLTIN_AGOLIA_INDICES is optional as they can also be passed and/or overriden on the command line but it is used to restrict which Moltin objects to generate Algolia indices for (ie. products,brands,categories,collections,orders,customers).

MOLTIN_CLIENT_ID and MOLTIN_CLIENT_SECRET are available in your Moltin Dashboard.

4. Run the application

NOTE: make sure that you've installed the dependencies in Step 1.

Ensure that the executable has proper permissions to run from the command line.

chmod +x ./bin/moltin-to-algolia

Execute the import command to import ALL of your products, brands, categories, collections, orders and customers into Algolia

NOTE: you can also run the import command with any subset of those entities to limit what is imported

Full import (run the following command):

./bin/moltin-to-algolia import

Partial import (run the following command specifying a comma seperated list w/o spaces of entities to index):

./bin/moltin-to-algolia import products,brands

NOTE: available entities to import: products,brands,categories,collections,orders,customers

5. Check your app in Algolia

Go to the app you've set up in Algolia's Dashboard (https://www.algolia.com/apps/[ALGOLIA_APP_ID]) and check the new indexes created. There should be one index created for each entity type imported.

You can then configure any specific Configuration data for that Index in Algolia to help further optimize search.

NOTE: it is reccomended that you adjust the Searchable Attribute Configuration for each index to only seach on specific fields.

That's it...have fun and take a look at Alogolia's InstantSearch from here to build an amazing front end for your indices!

6. Set up automated ongoing index updates from Moltin to Algolia

There is separate repository/package you can use to set up automated ongoing index updates from Moltin to Algolia using Moltin's Observable WebHooks and is fully compatible with the indices generated above. To set up the webhooks to automate create/update/delete entries in your index, please follow the instructions at the following:

https://github.com/uniquelyparticular/sync-moltin-to-algolia

Contact Adam Grohs @ Particular. for any questions.