Loaders, actions and workflows for adding Agolia search, the leader in globally scalable, secure, digital search and discovery experiences that are ultrafast and reliable, to your deco.cx website.
Algolia is a general purpose indexer. This means you can save any Json document and later retrieve it using the Search API. Although being a simpler solution than competing alternatives like Elastic Search or Solar, setting up an index on Algolia still requires some software engineering, like setting up searchable fields, facet fields and sorting indices. Hopefully, deco.cx introduces canonical types, like Product, ProductGroup, etc. These schemas allow this app to built solutions for common use-cases, like indexing Products for a Product Listing Page.
Installation
- Install via decohub
- Open your Algolia dashboard and grab your keys at settings > API Keys
- Copy & Paste your Application ID and Admin API Key
- Save & Publish this block
- Click on the button below to setup the necessary indices on Algolia
Use
Admin API Key
instead ofSearch-Only API Key
since this app tweaks search params and create/deletes records
Integrating to Algolia
This App uses deco.cx canonical types in a push-based architecture. This means anyone interested in indexing any supported canonical type just need to invoke the right workflow passing the right input payload. Below you can see the schematics of how ecommerce platforms use the workflows/index/product.ts
workflow for indexing products
As you can see, this App already receives the Product
as input parameter, so it's up to the ecommerce platform integration to invoke the workflow.
If you want to use Algolia with a supported ecommerce platform (VTEX, VNDA, Wake etc), install the ecommerce platform app and register Algolia workflow to listen to product events.
If you want to implement a new platform integration, you can base yourself on existing trigger implementation at VTEX/workflows/events.ts
VTEX Integration
To integrate with VTEX:
- Open your admin at deco.cx
- Under Blocks > Apps, make sure both VTEX and Algolia apps are installed
- Connect a product update event from VTEX into Algolia. For this:
- Under Blocks > Workflows -> events.ts open your VTEX-trigger block.
- Connect
Product
event from VTEX into Algolia by clicking on+ Add Product
and selectingAlgolia Integration - Product Event
- Connect
- Save & Publish
🎉 Your setup is complete! You should now be able to see the products being indexed on Algolia.
After indexing is complete, you can open your Pages at deco.cx and change loaders to Algolia Loaders