Skip to content

chefprep/shopify-algolia-lambda

 
 

Repository files navigation

Shopify / Algolia Integration

This Module is a deep integration with Shopify and Algolia allowing you to rank, facet and replicate products including multi location inventory

This module deploys to AWS Lambda

alt text

alt text

Install

You'll need serverless to run this and a AWS account or other provider

npm install -g serverless

Config

set a .env file

SWELL_STORE_ID=***
SWELL_SECRET_KEY=***
TODO

Algolia Config

Update the Algolia config (algolia.config.json) to what you need for your project.

Field Description
defaultRanking The ranking of your default index ALGOLIA_INDEX
rankings The individual rankings for using sort, will create a seperate replica per ranking
searchableAttributes Algolia searchable Attributes
attributesForFaceting Algolia Facetable Attributes
{
  "defaultRanking": ["desc(name)"],
  "rankings": [
    {
      "suffix": "price_desc",
      "ranking": [
        "desc(price)"
      ]
    },
    {
      "suffix": "price_asc",
      "ranking": [
        "desc(price)"
      ]
    }
  ],
  "searchableAttributes": ["name"],
  "attributesForFaceting": ["attribute.brand", "categories"]
}

Quick Start

The commands below will deploy the serverless function to AWS then create the indexes

sls deploy
sls invoke --function init
sls invoke --function reindex

sls invoke --function init will create the replicas based on your algolia.config.json sls invoke --function reindex will pull all the products into Algolia

Install webhooks on Shopify

TODO

About

a lambda function that indexes products & categories from Shopify to Algolia

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%