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./sync-moltin-to-algolia

v1.1.5

Published

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

Downloads

13

Readme

@particular./sync-moltin-to-algolia

npm version semantic-release code style: prettier CircleCI

Add/Update a Algolia indexed object when an object is created or modified in moltin

Asynchronous microservice that is triggered by moltin webhooks to add/update an object inside of Algolia.

Built with Micro! 🤩

🛠 Setup

Both an Algolia and moltin account are needed for this to function.

Create a .env at the project root with the following credentials:

MOLTIN_CLIENT_ID=
MOLTIN_CLIENT_SECRET=
MOLTIN_WEBHOOK_SECRET=
ALGOLIA_APP_ID=
ALGOLIA_API_KEY=

MOLTIN_AGOLIA_INDICES is optional but it is used to restrict which Moltin objects to generate Algolia indices for (ie. products,brands,categories,collections,orders,customers).

Find your MOLTIN_CLIENT_ID and MOLTIN_CLIENT_SECRET inside of your moltin Dashboard's API keys.

MOLTIN_WEBHOOK_SECRET can be anything you want.

Find your ALGOLIA_APP_ID and ALGOLIA_API_KEY within your Algolia Dashboard by going to API keys for your App. Note, ALGOLIA_API_KEY should be set to your Algolia Admin API Key, not your Search-Only API Key.

📦 Package

Run the following command to build the app

yarn install

Start the development server

yarn dev

The server will typically start on PORT 3000, if not, make a note for the next step.

Start ngrok (change ngrok port below from 3000 if yarn dev deployed locally on different port above)

ngrok http 3000

Make a note of the https ngrok URL provided.

⛽️ Usage

Next head over to the moltin Webhook Settings area, add a new integration (Settings > Integrations and click Create).

Enter any name and description for your Integration. Moltin recommends you prefix the name with DEVELOPMENT: for any testing.

Next, enter the ngrok URL from above and MOLTIN_WEBHOOK_SECRET that you saved inside .env.

URL and Secret Key

Now finally you'll want to configure what Moltin Observables (ie. Products, Brands, Categories, Collections, Orders, Customers) will cause this webhook to be invoked. In this example we want to monitor the Products and Customers observables and select the Created, Updated and Deleted box.

Click Save to register your new Webhook with Moltin.

NOTE: this repository is based on a fantastic set of code from our partners at moltin, available at: https://github.com/moltin/integration-examples/tree/master/sync-catalog-to-algolia

🚀 Deploy

You can easily deploy this function to now.

Contact Adam Grohs @ Particular. for any questions.